It seems that some views, such as TextView, have their own addition or margin ... I mean that when I set textSize 16dp to textView, it takes more than 24 pixels to display this control on the hdpi device screen. Maybe I missed something, please help
<LinearLayout android:id="@+id/uc_button_title_panel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <View android:layout_width="match_parent" android:layout_height="1px" android:background="@color/closed_red" /> <TextView android:id="@+id/uc_button_title_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="0dp" android:includeFontPadding="false" android:background="@null" android:padding="0dp" android:text="@string/demo_text" android:textColor="#325083" android:textSize="16dp" android:textStyle="bold" /> <View android:layout_width="match_parent" android:layout_height="1px" android:background="@color/closed_red" /> </LinearLayout>
Orest source share