我想要将两个不同的的基线对齐放置在两个不同的RelativeLayouts
中。以下是我使用的代码:在两种不同的布局中对齐文本视图的基线
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<TextView
android:id="@+id/tv_city_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="City"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_city_b"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/tv_city"
android:background="@drawable/txt_field_white"/>
</RelativeLayout>
我要对齐的tv_city_a
基线与tv_city_b
但上面的代码是行不通的。
注:由于设计要求,我需要把TextView
的两个不同的RelativeLayout
的。我不能把它们放在一个。
编辑以下是我得到的输出:
能您发布您的输出或您的完整布局 –
删除paddingTop。 – Anukool
你可以把两个相对布局放在一些线性布局 –