Scrollview inside constraint layout does not scroll to the bottom of the parent constraint

前端 未结 10 1343
予麋鹿
予麋鹿 2020-12-03 02:34

I have a form which has around 12/13 fields. I used a Scrollview inside a constraint layout. Below is the hierarchy of the XML layout. The problem is, it doesn\

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 03:10

    You have two solutions for this problem (the same solution but in two ways to do it):

    1. If you put the Design mode in Android Studio, select your ScrollView and open attributes tab and in the layout_height, select "match_constraint".

    2. If you use the Text mode in Android Studio, use this:

      
      

    See that the ScrollView height is set to 0dp. Both of this ways resolve the same problem but these are the different ways to do it.

    The ScrollView is not the root view, I have a Constraint layout wrapping the ScrollView as you.

提交回复
热议问题