Reputation: 793
I have an ImageView in Android with a foto in it. That view should always have the same proportions no matter which device it is displayed on. In my example the width of the ImageView is 427 dp and the height is 250 dp. I choose this special width to make the picture cover the whole width of the layout in Android studio. Now my question is, how should I modify the raw pictures taken from my camera (or whatever device/tool) such that it fits to the desired proportions? I mean, the raw picture does not have the desired proportions. This is why I extracted an ereas out of the picture with the desired proportions. I could specify the pixels for that in the tool I use (IrfanView). The proportions shoudld be multiples of 427 and 250, meaning that the following options are possible (427, 250) (2 * 427,2 * 250) (3 * 427, 3 * 250) etc. Now I do not know what size to choose. The ImageView might need different proportions depending on the device it is displayed on. Does someone have a good advice how to do that. Here you see a screenshot of the ImageView
Update: As nobody has answered so far, I would like to ask you again, how I should decide about the size of pictures in Android given that the app would run on different devices with different screen sizes. What is your way of deciding about that?
I'd be happy for every comment
Update 2: Can nobody help me with that? This should be a common problem. I mean you create an app for different devices and you need a picture for that app. What size should the picture have.
Why does nobody answer? Is the question itself unclear? If so please tell me.
Upvotes: 0
Views: 235
Reputation: 1034
try this i think you need two define two dimen files. one for normal phone and one for tablet. One size define in all dimen files. if you load in mobile normal fonts which you define for mobile will be load, if tab then tab font size.
How to define dimens.xml for every different screen size in android?
Upvotes: 2