user3121403
user3121403

Reputation: 133

unit of measurement in android that replaces em in html?

In Html we could use em, and it would adjust the size and format of everything to the appropriate size despite Resolution. Does android have a unit of measurement that adjusts views to its appropriate sizes and formats despite the different screen resolutions?

Upvotes: 0

Views: 453

Answers (3)

Lingeshwaran
Lingeshwaran

Reputation: 579

you can normally use dp,sp, for ref

Upvotes: 2

Phantômaxx
Phantômaxx

Reputation: 38098

You normally use dp for View sizes.
And sp for font sizes.

Upvotes: 2

Rachel Gallen
Rachel Gallen

Reputation: 28583

Android uses scalable points or SP

here is a sample

<TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Sample Text - 26sp"
        android:textSize="26sp" />

Reference

Upvotes: 2

Related Questions