I had the xml as shown below, but dit why the second TextView not align to the top of the LinearLayout?
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal"
android:background="@color/colorAccent">
<TextView
android:id="@+id/tv_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16dp"
android:text="AAAA"/>
<TextView
android:id="@+id/tv_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="9dp"
android:text="BBBB"/>
</LinearLayout>
and the result is
The TextView with id "tv_2" did not align to the LinearLayout and seems like had several pixes space, I'll be very appreciate that anyone can tell me the reason.