0
我的用户界面看起来像在横向模式:Android的横向模式很糟糕
但我想有他们在平行。所以应该有宽度/ 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>
预先感谢您的帮助!
如果我正确理解你的问题,你可以将'LinearLayout'的方向设置为'horizontal':'android:orientation =“horizontal”' – antonio
谢谢,不知道这很容易! – mafioso