Whats the image size to keep in list view of size 70x70 in android - android-listview

I have the listview with each row have an image on left side and text on right side. I have the xml as shown in below.
<ImageView
android:id="#+id/ivMenuListImage"
android:layout_width="70dip"
android:layout_height="70dip"
android:layout_alignParentLeft="true"
android:scaleType="fitXY"
android:paddingLeft="2dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"/>
I have given the Height and Width as 70x70 and the Images are in higher pixels than this. The list view is displaying well. Now i dont want to use hardcode value. So i gave width and height as wrapcontent and resized the images as 70x70. But the images are looking very blured and image quality is very poor. Please help me.

If your image does not have higher resolution you may need to set
android:scaleType="centerInside"
in order not to stretch the image.
Update:
If you wish the row to appear "larger" on higher dpi devices, first you 1) set all your views' layout_height to wrap_content 2)Create png images with fixed width/height pixels for different density drawable folders. For example, in drawable-mdpi all your png images should have fixed height 70 pixel, then all the rows will appear to be 70dp high in mdpi devices. If you create images of height 96 pixel in hdpi folder, then all hdpi devices will look wider with 96dp height.

Related

How to keep the same resolution of canvas on different screen resolution?

First of all, sry for my English mistakes, I'm not a native English speaker.
I'm trying to make an UI which is composed of a canvas within different gameObject, and I would like that my canvas scales to the dimension of the screen but keeps its original resolution (16x9 portrait). If it is displayed on a tablet resolution (4x3) then an image is displayed in the space that is not covered by the canvas.
But actually all I've got is a canvas which scales to every resolution, and it changes the aspect of its child (for example a square becomes a rectangle).
Thank you for showing interest in my query!
UI's are heavy beasts. Canvas in Unity have a component attached to themm called Canvas Scaler which is set by default on Constant Pixel Size. You may try to set this property on Scale With Screen Size and then specify the base resolution you want to work with (usually 1920x1080 is a console standart). This is your first step
Then, to avoid strange Image scaling, you may check the property Preserve Aspect, this way the ration of the Sprite into your Image will remain the same indepently of the ratio of the Image
Last, you may play a bit with anchors but this is another story, you should let those at plain center at the beginning and come back to it when you will feel ready
Hope that helped ;)
Your canvas should have a component called Canvas Scaler. Here it should say Constant Pixel Size, change this to Scale With Screen Size and it should lock the Canvas to be the same width / height as the screen. If you want to lock an image to a specific width/height ratio, go to the Image component on the image and check the Preserve Aspect checkbox. This way if you have a 100x100 image, the images width will always be the same as the height. If you have a 200x100 image, the images width will always be twice the height, etc etc etc.

How can I resize image in pub package "flutter_native_splash"?

I am using flutter_native_splash 1.3.1 package to add splash screen to the app.
The image size is getting displayed bigger than the desired size on the splash screen. What is right approach to decrease the size of the image on the splash screen?
Unfortunately, I don't think you can do it. So the option is to resize your image to fit your screen. You can read about the resolution in this topic https://github.com/jonbhanson/flutter_native_splash/issues/89
I was having issues with this. I tried a lot of different suggestions from stackoverflow, but nothing worked. I eventually just added padding within the image around the logo I wanted to display. So the logo was about 1/3 of the image, centered in the middle and then used center for gravity
<bitmap android:gravity="center" android:src="#drawable/splash" />
The images are all called splash.png.
The images sizes were all squares and had the dimensions:
hdpi 192X192,
xhdpi 288X288,
xxhdpi 384X384,
xxxhdpi 1024X1024
It is stated in the documentation that the image will be stretched to fit the screen. I think the best solution is to make your image with an aspect ratio of 9x16 (portrait) so the proportions stay the same.

Set Constraints of Image using XCode 11

I'm trying to constraint one dog image so that it is centered vertically in the container, which I can do. What I can't seem to get it is having it just above the halfway horizontal point. So I want it to be a certain fraction down the screen (say a third) on any device. I also want the size of the image to be relative to the screen size.
I want the image to be about what it is in the image but maintain its proportions relative to the device of the user.
I've tried tons of things and none of them work. Any help is appreciated.
Here's the Image
Create an UIView and set the image to fill the UIView. After that make the UIView top constrain equal to the centerY anchor which makes the UIView below center horizantal. By using layout anchors for width and height ( not fixed hard coded numbers) you will make it's size relative to device size so doesn't matter using any device type. Post a graphical design if you need more specific answer.

find proportional height of UIImage from fixed width in iphone

Hello my question is very similar to this question
I am arranging images in a grid manner. this grid has three columns, every column has fixed width of 100px and i want to scale UIImage with this width.
For better explanation i have attached an image
As shown in image i want to find the height.
I suggest you, if possible, use PSCollectionView for this type of display.

Correct map settings with Tiled For Iphone

So i am using tiled to create levels for my new iphone game.
The when creating a map with tiled for iphone the correct map size is 50x50 and tile size 32x32.
The problem is with these dimensions the tiles are to small for what i need it for.
So i have tried doubling the settings to map size 100x100 and tile size 64x64 but no luck..
Anyone familiar with doing this?
The goal is i would like the tiles to be bigger and take up more of the screen space. If you dont get the settings right, the map wont show up correctly on the screen half of it will be hanging of.
There's two things to consider: the size of your tiles must match the tile size setting in Tiled, otherwise they will not align correctly. If you double tile size to 64x64 you also have to double the size of the tileset image.
The other thing is how many tiles fit on the screen. If you divide 480 by 64 you get 7.5 meaning 7 and a half tiles fit on the screen on the horizontal direction (assuming landscape mode). If that's what you need, you'll have to make sure the tile size is clearly divisible by 480x320 respectively 1024x768 on iPad or 568x320 on widescreen devices.