【发布时间】:2016-10-25 03:33:36
【问题描述】:
我查看了Here,但仍然无法解决我的问题。
我最近跳入了 android (headfirst) 并且一直在搞乱。无论屏幕以哪种方式倾斜,我都希望我的应用程序仅在横向模式下运行。
我的主屏幕基本上是一个带有背景的页面和几个在右侧对齐的按钮。
这是我的 XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingLeft = "450px"
android:paddingRight = "60px"
android:paddingTop="25px"
//I have tried adding orientation commands here like the one below??
android:screenOrientation="landscape"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background = "@drawable/sign"
>
<Button
android:id="@+id/Button1"
android.layout_height="60px"
android.layout_width="30px"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="Button1"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:id="@+id/Button2"
android.layout_height="60px"
android.layout_width="30px"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="Button2"/>
【问题讨论】:
-
bahh 谢谢大家,我更改了错误的文件。我链接到的另一个问题本来可以解决问题
标签: android xml android-layout