What picture size to use in Android layouts2020-01-11 android imageview
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.
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.
- Is there a unique Android device ID?
- Close/hide android soft keyboard
- Is there a way to run Python on Android?
- What is 'Context' on Android?
- Proper use cases for Android UserManager.isUserAGoat()?
- How to stop EditText from gaining focus at Activity startup in Android
- What is the simplest and most robust way to get the user's current location on Android?
- What is the difference between "px", "dip", "dp" and "sp"?
- Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23