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