button autoresize - iphone

Can anyone help me with the small buttons/icons used within the iphone apps. I am fairly new to the app world and trying to make some buttons(viz the tick box) for my app. I am not sure if we should start with a 50X50 and autoresize in the app or just have a 20X20 which exactly fits the space...
Any help on this is appreciated..

According to Apple, buttons should be at least 44px wide, and 44px high (unless they're by themselves with nothing near them, in which case 22px high). If you're laying out buttons in IB, I'd say get them placed correctly, and set their 'springs and struts' to autosize for you.

Try to do like this,
Put 50*50 button that you need in your project ,and add an image to your interface builder,
select the image that you put recently in Button attributes and select button size by ctrl+3
and set it to 20*20 it works ,it works for me also...

Related

making buttons with the same spacing by giving Autolayout constraints

I gave constraints to the buttons.
enter image description here
Hello, I was working my app on iPhone 11 Pro max in the storyboard, and when I runt it on (iPad 7 Generation), It has much more spacing between the last button and the leading side of the view.
enter image description here
So, I gave the trailing space to the container, and it looked this in the storyboard
enter image description here
on the iPad 7generation simulator, it looked this way.
enter image description here
it's got much more spacing between the 3rd button and the last button. How can I make the buttons align with the same spacing?
The StackView suggested by Steve is a nice solution. Or try the snippet below if you want to make it work without a StackView.
To evenly spread buttons horizontally across the screen use the following, an example for 3 buttons:
"H:|[spacer0(>=0)][button0][spacer1(==spacer0)][button1(==button0)][spacer2(==spacer0)][button2(==button0)][spacer3(==spacer0)]|"

Swift Auto Button Resize

Is there any way I can automatically adjust my buttons' sizes. On iPhone 6 and 7 it looks really good. When I go to iPhone 8 and up the buttons appear to be too small. I was doing some research and I couldn't really find anything. This is also in Swift and Xcode.
You can use constraints that autoresize the button based on text size.
Added images for refrences.

Interface design in iPhone and iPad using Autolayout?

I am developing one application to support both iPhone and iPad. i am using Autolayout for interface design in universal storyboard. i have two textFields and one button . i am adding layout constraints for my components like this( and ). finally my iPhone screen looking like .This how exact i need . But if i run the app in iPad2 the screen is looking like below image . Here textiles and button Width is changing Based on screen size but Textfields and button Height not changing based screen height?. Can anybody tell me how to solve this. I am using Autolayout first time and struggling since morning?
Okay so you have two options here-
1. Under textField, choose the border style I'm attaching below. Then you can change the height of the textField, in the storyboard itself. When you constraint your view, then just don't specify a fixed heigh constraint, and everything should work okay.
2. If you use a textField, then you can just resize it to your needs, and then implement the same constraint specs. But, I personally like textFields more, because they give you options like letting the user enter Secure Text, among other options.

UIImageView is shifting down when viewed on 4 inch iphone

I am trying to figure out what settings for the UIImageView below will work with all device sizes.
I'm getting no luck with every combination I've tried.
Here's the .xib:
When I run this on a 4" the image is shifted down much lower from the top label and the buttons stay put.
I have the top label set to Top, tried Aspect Fit/Fill for it as well, didn't change anything. Seems to be an issue with the UIImageView. Also saw someone mention try clip subviews, have that selected, still can't keep it the same size and orientation when going back and forth from 3.5" to 4" iphone on device and simulator.
Hope this helps, in your case you should keep it to the default setting, no change required..
First if turn off the Autolayout setting from XIB.
Now visit my answer here.

X button with circle in iPhone Controls

You know that grey circle with white "X" in it in textboxes for iPhone controls that is used to delete the current line of text, is that available as an icon somewhere? I'd like to put that icon along with the words "Clear" into a UIButton but not sure if that is availalbe. Thanks.
Apple's website uses a reset icon in its search field that you could download. Not sure how well it will work with the iPhone 4 display PPI though. (It doesn't seem to appear when I visit the site with an iPhone.)
This is not part of the public API, you'd have to use your own custom image. Which could simply mean using an editor to slice it out of a screen shot.