Trying to understand margins in LinearLayout inside a ScrollView

后端 未结 2 771
粉色の甜心
粉色の甜心 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:21

    I digged a little bit into the source code:

    ScrollView extends FrameLayout. This one has some margin issues itself and ScrollView is not even trying to solve that. The margins are basically ignored while measuaring.

    But in the end it doesn't matter since you should be able to define a padding on the ScrollView itself (it's an affirmation, didn't try that). There should be no need for margin for a single child view.

提交回复
热议问题