I always use LinearLayout and RelativeLayouts, and i was reading about the "new" PercentRelativeLayout. I have a few questions:
Should i always start using this one or only in cases of nested weights with linearlayout?
Is this more performant than the others?
Any other information about PercentRelativeLayout it will be welcome.
Thanks!
is just a extension of
RelativeLayout
so i think:1) u should use it in case of nested weights with linearlayout as they are bad for performance
2)No,but depends on your useCase. For ex:-it has less performance than
LinearLayout
andRelativeLayout
but more thanLinearLayout
with nested weightAlso u can refer this post from android developer: http://developer.android.com/training/improving-layouts/optimizing-layout.html
Looking at the source code, a PercentRelativeLayout is basically a minor extension of a RelativeLayout. This means you need to make the same considerations as when you choose between a RelativeLayout and LinearLayout.
Finally it is worth noting that:
Try PercentRelativeLayout and PercentFrameLayout of Percent Support Library
http://android-er.blogspot.in/2015/08/try-percentrelativelayout-and.html
here you can find best comparison for both layouts.