【发布时间】:2023-03-09 02:53:01
【问题描述】:
我的应用有登录屏幕,它支持横向和纵向。它工作正常。我的问题是在纵向模式下单击编辑文本时显示键盘很好。画面如下:
但是横向模式看起来不像纵向模式。屏幕看起来像横向模式:
这是我的清单代码:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.activities"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<!-- Allow to connect with internet -->
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/launcher_icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- Add Google Map Library -->
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:noHistory="true" android:theme="@style/generalNoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" android:theme="@style/generalNoTitle" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".MenuActivity" android:theme="@style/generalNoTitle" />
<activity android:name=".RegularReportsActivity" android:theme="@style/generalNoTitle" android:screenOrientation="landscape"/>
<activity android:name=".StageMaleAndFemaleActivity" android:theme="@style/generalNoTitle" android:screenOrientation="landscape"/>
<activity android:name=".MapViewActivity" android:theme="@style/generalNoTitle" android:screenOrientation="landscape"/>
<activity android:name=".ReportViewActivity" android:theme="@style/generalNoTitle" android:screenOrientation="landscape"/>
</application>
</manifest>
如何在横向模式下像纵向模式一样显示?还有,谁能指导我?
【问题讨论】:
-
这是自定义键盘吗?
-
在滚动视图中添加您的所有视图,并 android:configChanges="keyboardHidden|orientation" 将此添加到清单中的活动标签中,这将解决您的问题
-
@lokoko 没有默认键盘
标签: android keyboard android-keypad