Android WebView: how to let the css use the entire height w/ position absolute?

后端 未结 1 1792
执笔经年
执笔经年 2021-01-20 03:53

I have a very responsive html/css page that uses position:absolute to put elements in place. e.g. a username input will have

position:absolute;
top:30%;
heig         


        
相关标签:
1条回答
  • 2021-01-20 04:02

    So in my case the problem was that I was setting the height of WebView using align parent instead of math_parent.

    I was using this:

    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    

    instead of this, THE RIGHT WAY:

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    
    0 讨论(0)
提交回复
热议问题