Gil*_*ang 3 android android-layout android-fullscreen
我正在以全屏模式开发一个Android应用程序。我希望在显示软输入时自动调整屏幕。我正在使用ScrollView使我的屏幕可以扩展到大于最大高度。您可以在下面看到布局XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="${packageName}.${activityClass}" >
<VideoView
android:id="@+id/taskdetail_bgvideo"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />
<ScrollView
android:id="@+id/taskdetail_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- Other Widgets -->
</LinearLayout>
</ScrollView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
将VideoView放置在背景中,以便在整体布局中创建背景视频。
我在Android中尝试了变通方法,当软键盘可见时如何在全屏模式下调整布局,但就我而言,它无法按预期工作。当我选择最底部的TextView时,所有屏幕都以某种方式向上推到顶部,在软键盘和活动屏幕之间留有很大的黑色区域。查看下面的屏幕截图(很抱歉,信誉仍然很低,因此无法直接发布图像:()
那么,您有什么可能的主意来解决这种奇怪的行为吗?另外,我还尝试将softInputMode设置为ADJUST_RESIZE或ADJUST_PAN,这两个设置都可以做到这一点。当我将其设置为ADJUST_NOTHING时,没有任何调整。
当我不使用上面提到的解决方法时,无法将视图滚动到最底部的窗口小部件,但是以某种方式将窗口视图平移到聚焦的TextView上。我认为这实际上是罪魁祸首,但我不知道如何解决。
提前致谢 :)
如果您<item name="windowFullscreen">true</item>
在主题中具有该属性,则该属性将android:windowSoftInputMode="adjustResize"
不起作用。
归档时间: |
|
查看次数: |
3264 次 |
最近记录: |