Wygląda na to, że niektóre widoki, takie jak TextView, mają własne dopełnienie lub margines ... Mam na myśli, że gdy ustawiam textSize 16dp na textView, to na ekranie urządzenia hdpi potrzeba więcej niż 24 pikseli, aby wyświetlić tę kontrolkę . Może ja czegoś brakuje, prosimy o pomocWidok android domyślne wypełnienie lub marginesy
<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>
Czy spodziewasz się, że będzie dokładnie 24 oparte na mnożniku 1,5x stąd: http://developer.android.com/guide/practices/screens_support.html? –
No tak ... Przypuszczam, że jeśli chcę uzyskać rozmiar tekstu 24px na urządzeniu hdpi, muszę ustawić textSize na 16dp czy nie? – Orest
Tak, masz rację, tylko próbujesz zrozumieć związek. Czy mówisz, że rzeczywisty tekst jest większy niż 24 piksele lub tekst + przestrzeń wokół niego? –