Android Soft-Key-Buttons hide view's content

前端 未结 2 1637
遥遥无期
遥遥无期 2021-01-06 05:36

I\'m having troubles with layouts being too large on Devices with Soft-Key-Buttons on Android:

Summing up, my question is why a layout, which is configured as

相关标签:
2条回答
  • 2021-01-06 06:02

    This one worked for me, just add it to your v21/styles.xml

    <item name="android:windowDrawsSystemBarBackgrounds">false</item>
    
    0 讨论(0)
  • 2021-01-06 06:07

    I can imagine three different scenarios:

    1. (Unlikely)You do something with LayoutParams Flags of your Window(like getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);) and/or Theme's styles

    2. (Unlikely. It was my initial though, but layout_alignParentBottom="true" should handle it for you)You don't have enough space on the screen. Can you wrap your RelativeLayout into a ScrollView(it'd require you to change RelativeLayout's height to wrap_content) and see the result? (If you set match_parent to the RelativeLayout it does not mean it'd fit all content into the screen sizes. Content can easily get out of the screen, like on the screenshot you provided. But again, layout_alignParentBottom="true" handles it.

    3. (Most likely) You have some margins/paddings in the Activity(especially, something like android:layout_marginBottom="-XXdp"), which hosts Fragment. So fragment is rendering correctly, but the Activity moves it below the screen.

    To speak more precisely, it'd be nice to have @style/AppBaseTheme here, Activity's layout and if you do something suspicious with getWindow() - this piece of code.

    Let me know, if it helps or not!

    0 讨论(0)
提交回复
热议问题