我有一个简单的LinearLayout,我试着让它看起来像这样: TextView的重力下不工作
我的XML是:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="miasto"
android:textSize="10sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="ulica"
android:textSize="15sp"
android:gravity="bottom"
/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="30sp"
android:text="22"
android:gravity="bottom"/>
</LinearLayout>
为什么gravity =“bottom”不起作用?
答案就在这里: https://stackoverflow.com/questions/4768738/android-textview-remove-spacing-and-padding-on-top-and-bottom –