Android Scrollview in RelativeLayout with ButtonBar

前端 未结 2 1374
陌清茗
陌清茗 2021-01-05 00:50

I\'m trying to implement a login view where several EditTexts and a logo are displayed on the screen with a ButtonBar at the bottom, something like this:

alt text ht

2条回答
  •  一生所求
    2021-01-05 01:33

    It turned out that the solution required two steps:

    1. The inability to scroll was a result of the ScrollView being behind the Button Bar. To fix this, I defined the ScrollView below the Button Bar, then used android:layout_above="@id/buttonbar_login" to force the ScrollView to reside entirely above the Button Bar.

    2. Apparently when the onscreen keyboard is opened, if you have a ScrollView it will be resized allowing the Button Bar to float up with the keyboard. To fix this I modified the manifest and added android:windowSoftInputMode="adjustPan" to prevent the ScrollView from resizing.

提交回复
热议问题