繁体   English   中英

在选项卡式布局的底部对齐TextView

[英]Align TextView bottom of Tabbed layout

我正在尝试将TextView与Tab布局的底部对齐,因此它与屏幕底部齐平。 它基本上将等效于浏览器状态栏,因此它只有几个像素高,其中包含一些文本。 这是我到目前为止的内容:

 <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0dp" <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="0dp" android:background="@drawable/tab_bg_selector" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0dp" /> <TextView android:id="@+id/status" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Last Updated" android:layout_alignParentBottom="true" android:background="#cccccc" /> </LinearLayout> <RelativeLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="10dp" android:layout_alignParentBottom="true"> <TextView android:id="@+id/status" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#cccccc" /> </RelativeLayout> </TabHost> 

您已将TextView的高度和宽度设置为“ fill_parent”。 这意味着视图本身的底部在底部,但是视图中的文本可能在其布局的顶部。 您应该将高度设置为“ wrap_content”。 由于视图只有需要的高度,因此它应该出现在布局的底部。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM