How to create a style for ImageView on Android?

0

How do I create a style format for ImageView by moving to length and height in this style so it gets "formatted" on the screen?

    
asked by anonymous 11.03.2016 / 17:07

1 answer

2

You can specify fixed sizes in the dimens.xml file that is in the res/values/ folder.

For screens over 820dp (7 "and 10" screens) you include in the dimension.xml file inside the res/values-w820dp/

Example:

<ImageView
    android:layout_width="@dimen/image_view_w"
    android:layout_height="@dimen/image_view_h”
...  
>
</ImageView>

dimension.xml:

<dimen name="image_view_w">55dp</dimen>
<dimen name="image_view_h">55dp</dimen>
    
11.03.2016 / 20:32