我的用户界面在横向模式下看起来像这样:
但我想让它们并行。所以应该有宽度/ 2而不是高度/ 2。那么我该如何改变呢?
我的代码如下所示:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/photo"
android:layout_weight="0.5"
android:id="@+id/btnTakePhoto" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/video"
android:layout_weight="0.5"
android:id="@+id/btnRecordVideo"
/>
</LinearLayout>
</FrameLayout>
在此先感谢您的帮助!