android_UI_RelativeLayout_android:layout_alignBaseline

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="15dp" >
    <TextView
        android:id="@+id/title_add_txt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#5500ff00"
        android:padding="5dp"
        android:text="Title"
        android:textColor="#ffffff"
        android:textSize="18dp" />
    <EditText
        android:id="@+id/address_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/title_add_txt"
        android:layout_alignBaseline="@id/title_add_txt"
        android:hint="Address Title" />
    <TextView
        android:id="@+id/address_txt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/title_add_txt"
        android:layout_marginTop="10dp"
        android:background="#5500ff00"
        android:padding="5dp"
        android:text="Address"
        android:textColor="#ffffffff"
        android:textSize="18dp" />
    <EditText
        android:id="@+id/address"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/address_title"
        android:layout_toRightOf="@id/address_txt"
        android:layout_alignBaseline="@id/address_txt"
        android:hint="Address" />
</RelativeLayout>


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这段代码定义了一个垂直排列的LinearLayout,其中包含一个RelativeLayout作为顶部栏,里面包括一个居中显示的TextView和一个右侧对齐的ImageView。 具体解释如下: - LinearLayout:定义了一个垂直排列的布局。 - android:orientation="vertical":设置LinearLayout的方向为垂直。 - android:layout_width="match_parent":设置LinearLayout的宽度为match_parent,即与父容器宽度相同。 - android:layout_height="match_parent":设置LinearLayout的高度为match_parent,即与父容器高度相同。 - RelativeLayout:定义了一个相对布局。 - android:layout_width="wrap_content":设置RelativeLayout的宽度为包裹内容。 - android:layout_height="48dp":设置RelativeLayout的高度为48dp。 - android:background="@android:color/holo_red_light":设置RelativeLayout的背景颜色为淡红色。 - TextView:定义了一个文本视图。 - android:layout_width="wrap_content":设置TextView的宽度为包裹内容。 - android:layout_height="wrap_content":设置TextView的高度为包裹内容。 - android:text="商品详情":设置TextView的文本内容为“商品详情”。 - android:textSize="24sp":设置TextView的文本大小为24sp。 - android:layout_centerVertical="true":设置TextView在垂直方向上居中对齐。 - android:layout_centerHorizontal="true":设置TextView在水平方向上居中对齐。 - ImageView:定义了一个图像视图。 - android:id="@+id/iv_me":为ImageView设置一个唯一的标识符,以便在代码中引用。 - android:layout_width="wrap_content":设置ImageView的宽度为包裹内容。 - android:layout_height="wrap_content":设置ImageView的高度为包裹内容。 - android:src="@mipmap/icon_shopping_car":设置ImageView的图像源为指定的图片资源。 - android:layout_alignParentRight="true":设置ImageView在父容器的右侧对齐。 - android:layout_centerVertical="true":设置ImageView在垂直方向上居中对齐。 - android:padding="12dp":设置ImageView的内边距为12dp。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值