I'll show you how to do the same taking advantage of a RelativeLayout and a TextView's compoundDrawable:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_margin="8dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:drawableTop="@drawable/plano"
android:drawablePadding="8dp"
android:text="Plano"
android:textSize="23sp"
android:textStyle="bold"
/>
</RelativeLayout>
Compound drawables help keeping down the View count, and therefore intrinsically speed up the layout
The key is android:drawableTop="@drawable/plano"
This replaces the top image.
You can also set a Right, Left, Bottom side image.
Even all together.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…