LinearLayout doesn't have margins after iflating ViewStub. After inflating I can set margins only programmaticaly or there is another way?
I ran into the same issue but with a RelativeLayout. I fixed it by putting the margins on the ViewStub definition. This may not be the best way to do it, the best way might be having a hierarchical layout where the first child of your root layout is the one that has the margins set and contains all other elements.
Not sure of the root cause for this, but these are the two workarounds I know of.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With