android 两端对齐,LinearLayout子控件两端对齐
1、实例:
android:id="@+id/settingBtnContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:id="@+id/settingBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设置"
android:textSize="20sp" />
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:id="@+id/settingBtnIcn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_baseline_keyboard_arrow_right_24" />
2、解决方案
在中间加入以下代码即可
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
总结
以上是生活随笔为你收集整理的android 两端对齐,LinearLayout子控件两端对齐的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: android 图像对比,Android
- 下一篇: 优酷复制的html代码怎么用,关于网页上