【发布时间】:2017-09-30 01:49:55
【问题描述】:
我正在开发 Xamarin Android 应用程序(不是表单)。当我运行它时,即使它没有固定为纵向或横向,它也不会旋转。以前它运行得很完美,但最近我改变了一些影响旋转的东西(我显然不记得了)。我在网上搜索了很多,但我只找到了讨论肖像或风景的文章和问题。 (注意:当我打开一个类似的应用程序并旋转它时。它完美地显示了风景。然后当我选择我的应用程序时,旋转工作完美。这意味着它不会首先旋转,或者除非我们在横向模式下选择类似的应用程序)
我的主要活动如下所示
[Activity(Label = "Thoughts Express", MainLauncher = true, Icon = "@drawable/Icon", ConfigurationChanges = Android.Content.PM.ConfigChanges.ScreenSize | Android.Content.PM.ConfigChanges.Orientation)]
而axml就像
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarAlwaysDrawHorizontalTrack="true"
android:scrollbars="horizontal"
android:scrollbarStyle="outsideOverlay"
android:id="@+id/LLMain">
<TableLayout
android:minWidth="25px"
android:minHeight="25px".......
</TableLayout>
</LinearLayout>
如下所示
<application android:icon="@drawable/Icon" android:label="Thoughts Express" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"></application>
【问题讨论】:
-
提供一些代码
标签: android xamarin xamarin.android rotation