PercentRelativeLayout inside ScrollView

后端 未结 4 2087
忘掉有多难
忘掉有多难 2021-01-07 22:58

I have created a layout using a ScrollView which has a PercentRelativeLayout as its child. It doesn\'t work on Lollipop and older devices but works

4条回答
  •  梦谈多话
    2021-01-07 23:12

    The question as I understand it is: I want these TextViews to be 50% width of parent view.

    Way that works for me is:

    
    

    Then allign the View(s) to that. Either the RelativeLayout or the TextViews. You lose the control (if you ever had it) over the percentage of the RelativeLayout. I tend to go with things like:

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
    

    Does this help?

提交回复
热议问题