我在我的 xml 中有一个滚动视图,但滚动视图应该只在手机的横向模式下工作,而不是在手机的纵向模式下工作。这是可能的吗?如果可能的话,我应该使用 xml 文件或通过编程方式。如果代码需要请问我。谢谢
这是xml文件(纵向模式):
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#1e90ff"
tools:context=".HomeActivity"
android:scrollbars="none"
>
<LinearLayout
android:id="@+id/layout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#a9a9a9"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:background="@drawable/my_tauky_button_img" />
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:background="@drawable/explore_button_img"
android:text="" />
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:background="@drawable/create_tauky_button_img" />
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:background="@drawable/my_blauky_button_img" />
<Button
android:id="@+id/button5"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="@drawable/profile_button_img" />
</LinearLayout>
</ScrollView>