If you are using the
RelativeLayout class, you may be able to achieve the same effect, at lower cost, by using nested, unweighted
LinearLayout views instead. Additionally, if your app targets Android 7.0 (API level 24), it is likely that you can use a special layout editor to create a
ConstraintLayout object instead of
RelativeLayout. Doing so allows you to avoid many of the issues this section describes. The
ConstraintLayout class offers similar layout control, but with much-improved performance. This class uses its own constraint-solving system to resolve relationships between views in a very different way from standard layouts.