0
How to create a format style for ImageView
passing to length and height in this style so it gets "formatted" on the screen?
0
How to create a format style for ImageView
passing to length and height in this style so it gets "formatted" on the screen?
2
You can specify fixed file sizes dimens.xml
which is in the folder res/values/
.
For screens with more than 820dp (screens of 7" and 10") you include in the file dimens.xml inside the folder res/values-w820dp/
Example:
<ImageView
android:layout_width="@dimen/image_view_w"
android:layout_height="@dimen/image_view_h”
...
>
</ImageView>
dimens.xml:
<dimen name="image_view_w">55dp</dimen>
<dimen name="image_view_h">55dp</dimen>
@Thiagoluizdomascoski I will test first, then and I mark as solved blz.
how to pass this command via code?
imageView.setLayoutParams(new LinearLayout.LayoutParams(R.dimen.image_view_w, R.dimen.image_view_h));
but it moves the image size and not imageView
Browser other questions tagged android xml
You are not signed in. Login or sign up in order to post.
Dude, I don’t quite understand your question. There’s a way to clarify?
– Dener
Could define better screen formatted? You want it to respect the size of the screen?
– Thiago Luiz Domacoski
@Thiagoluizdomacoski not this, imagine a rectangle I want to pass to this
IamgeView
which shall have this format as measures specified in style– Vale
This you want to do via code? Pass height and width in Java?
– Thiago Luiz Domacoski
@Thiagoluizdomacoski may be, but I was thinking
xml
in thestyles
– Vale