I am making an iPad app and there are textfields with placeholders in it.
There are many textfields, so I don't know if the user will be able to see the placeholders.
Does anyone know what is the minimum font size advisable for a placeholder? I don't want the user to keep zooming to see what the placeholder says.
The placeholder's default size itself should be fine. As of modifying the size - it is a string and hence you can't modify the textsize attributes.
Related
i want to set Device-Specific font of UILabel and UIButton using storyboard.
Any one can help me to achieve this?
You can set Label Font Size based on Device using Storyboard. To make it you have follow some steps like below.
First go to the Attributes Inspector panel in storyboard.
Click on this + Symbol of Font Property.
Now set the variations for other devices, Like Compact Width and Compact Height or etc. Set it based on your requirements.
Finally, it will look like,
you can set this property multiple times as per your device specifications like iPhone or iPad etc. You need to define only variations so it will automatic set font size and fonts also.
Hope you get it.
I am beginner in iOS app development, I am working on a project that was done by someone else. So my problem is the label is not fully showing its contents:
check the second column under 'customer name'.
I did some basic alterations to the label but it makes no change at all. This is a collection view, there is another view inside the collection view cell which holds the title label and description label.
I searched everywhere but didn't get any proper answer please help.
Label in iOS does not change its size to suit the contents, you need to adjust it in your code. Your options are either decrease the font size to suit the description label size, or adjust the description label's height/width to make room for current content. I'd do a combination of both (slightly reducing the font size of the label's text, and at the same time making all the cells a bit wider and taller).
Oh, there is also a way to automatically shrink the font size if the contents doesn't fit the space. So, you'd need to check the option for your description label. Here's how you might do it: how to make UILabel autosize text in storyboard (or interface builder), NOT programmatically
I have created a Launch screen.I have added one image & label on it.Now for diffrent screen size devices i am able to increase the size of image with autolayout.But i am not able to increase the font size of label.I can't use custom class of label for storyboard.So is there any way with i am able to increase font size for multiple devices on launch screen.
Option for different font size for different size class is available in storyboard.
NO. It is not possible to implement custom font for LaunchScreen, since LaunchScreen will be loaded before your custom fonts load. Better create different images with the text you want to display.
Well it is not possible you can write code for a launchScreen and handle some logic as for a conventional ViewController. Also you cannot use a custom class of label or extension. You can use only Auto-Layout and size classes. The detailed explanation is in the link
I've been trying to set different font sizes for different iPhone sizes. I researched a lot about this but couldn't find the proper way of doing it. All I found is how to change uilabel text size in different iPhones which shows how to change the font size based on hard coded values that too programmatically. I'm looking for changing the font size using storyboard i.e adaptive layout. Another popular answer I found was to add wC hAny in storyboard. But, this can only be used to set the different font size for an iPad and iPhone(not for different iPhone sizes). Any help would be appreciated.
One way to do this is to set the minimum font size for the label. Then set your constraints so when the labels get squished in a tighter area the font will shrink to fit on the screen.
Am adding an image to a NSAttributedString object so I can display them properly in a UITextView.
So far, it works great. Only problem is, my Font size is 25 to match my image size but each time I add an image to the UITextView, the Font resets to some smaller size. I need to keep the font at 25 to match texts with the image size.
NSAttributedString has 3 constructors which take string, attributedString and string:attributes:.
Since I'm not using string, I can't set the attributes using the third constructor and the first 2 won't allow me to set attributes (UIFont). I therefore decided to set the Font size from Interface Builder and reset it each time I add an image to the `UITextField.
Am facing a problem here because each time I reset the font, the UITextView scrolls to the first line (assuming there is so much text, it has scrolled up). How do I set font size after adding image without the UITextView scrolling up automatically? Better still, is there a better way of doing this? Thanks.
NSMutableAttributed string has some methods you may try, including setting attributes across ranges after the attributed string is constructed.