PHP直播源码,水平平分两个按钮相关的代码
把原来的相对布局换为了水平布局LinearLayout,orientation属性设置为horizontal水平摆放,然后在里面添加两个相对布局RelativeLayout,最后把两个按钮分别放置在相对布局的中心就可以了。
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="10dp"
android:layout_weight="2"
android:orientation="horizontal"
android:baselineAligned="false">
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_margin="10dp"
android:orientation="horizontal">
android:id="@+id/camera_btn"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:background="@drawable/xiangji"
/>
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_margin="10dp"
android:orientation="horizontal"
>
android:id="@+id/album_btn"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_centerInParent="true"
android:background="@drawable/xiangce" />
以上就是
PHP直播源码,水平平分两个按钮相关的代码, 更多内容欢迎关注之后的文章