Trying to understand margins in LinearLayout inside a ScrollView

后端 未结 2 769
粉色の甜心
粉色の甜心 2021-02-07 00:02

I need to have a LinearLayout inside a SrollView and that LinearLayout must have a margin from the ScrollView. At first, the

2条回答
  •  一整个雨季
    2021-02-07 00:14

    Hello Knickedi and Ricardo Amaral,

    Though this answer is marked as solved but I want to put some lights on the issue.

    As Knickedi said, ScrollView extends FrameLayout.

    So My answer is that You can set the layout_gravity of LinearLayout within scrollView and then layout_margin will work in LinearLayout as case with linearLayout within FrameLayout.

    I had same issue and I've applied this and it worked for me. :)

    Example :

    
    
                    
    
    

提交回复
热议问题