According to this video
If I want create some element, which must looks the same on devices with different dpi (Phone, Tablet, TV).
As shown on video (at 4:52), I must specify dimensions of this element in dp.
But I got this (Redmi Note vs Redmi 1s (android 4.2.2 on both)):
(I use IntelliJ Idea 14)
Here is my code from activity:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
android:textSize="60sp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="#ff080808">
</LinearLayout>
<Button
android:id="@+id/button"
android:layout_width="150dp"
android:layout_height="150dp"
android:text="New Button"/>
</LinearLayout>
Questions:
Why line height is not match on phones?
Why button is smaller on smaller screen?