How will you design a text view, which works properly for both mobiles and tablets?

Asked 22-Jan-2018
Viewed 363 times

1

How will you design a text view, which works properly for both mobiles and tablets?


1 Answer


0

to do this you simply need to create the layout file which contains the text view in the following directories

res/layout/my_layout.xml // layout for normal screen size ("default")

res/layout-small/my_layout.xml // layout for small screen size

res/layout-large/my_layout.xml // layout for large screen size

res/layout-xlarge/my_layout.xml // layout for extra large screen size

res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation

res/drawable-mdpi/my_icon.png // bitmap for medium density

res/drawable-hdpi/my_icon.png // bitmap for high density

res/drawable-xhdpi/my_icon.png // bitmap for extra high density

By doing this android will automatically display the correct layout on the basis of selection of screen.