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″ />
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/217951.html原文链接:https://javaforall.net
