![](/img/trans.png)
[英]how to get textview below another textview in row in android linear layout
[英]How to align buttons below textview in linear layout
我有一张桌子,每个单元格都有文字和三个按钮。
我希望按钮在文本视图的正下方对齐,但我不能让它们像那样对齐。
这是我的布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:descendantFocusability="blocksDescendants">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="15dip"
android:paddingLeft="5dip"
android:textStyle="bold"
android:paddingTop="5dip"
android:textColor="#000000"
android:textSize="16dip"
android:layout_toRightOf="@+id/track_no"/>
<LinearLayout
android:id="@+id/c1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageButton ../>
<ImageButton ../>
<ImageButton ../>
</LinearLayout>
</LinearLayout>
您是否尝试将顶部LinearLayout
的方向更改为vertical
? 像这样的东西。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:descendantFocusability="blocksDescendants">
你必须使用
android:orientation="vertical"
代替
android:orientation="horizontal"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.