iOS swift change padding of my custom font in application - ios

I am working on custom font,IRANSansMobile_Bold. This font unwanted bottom padding. can I change this bottom padding for entire application I have already use another font now it is not possible for me to add edgeInset in every control

Related

AutoLayout to dynamically size UILabel Height and Width in Map callout?

I have to populate data on 2 UILabels located in .xib. This is used for Google Map SDK iOS for a custom callout (in map annotation). How do I set constraints in interface builder using Auto-layout ?
Here is what I have for now. I need to make height and width dynamic. Thus some callout does not include arrow icon.
How each label attributes looks like:
Its almost there, what happening is container view doesn't expand/shrink according to description label.
What are the steps I should follow to build this view from scratch (for the learning purpose as well) ? Plus different ways this can be achieved?
Just change number of lines to "0" for label, auto layout will handle rest of the things. Remove height constraint because the height of the label will be determined by font size and number of lines of text.
.

iOS multiline label not gong to multi-line in Xcode 7.3

I'm trying to set this up and have always done this in code and would like to get this done in modern version of Xcode 7.3.
I do the following steps:
drag out a UILabel
set the number of lines to 0
set Line Breaks to Word Wrap
But this isn't breaking and representing all the data. The data is being populated though. What else do I need to do?
edit 2
added border for this
The problem is that when you do this in code, your label is not using auto layout. But when you drag into the storyboard, your label is using auto layout, so the rules are different. You need to add constraints.
What you do now depends on what you want. First you'll need constraints for top and left of the label. Then, if you add constraints for just width, the label will grow downwards as it fills with text. If you add constraints for both height and width, the label will simply fill up within that size.

Getting rid of whitespace inside a TextView in Interface Builder

I have an issue on iOS devices larger than 4 inches.
As you can see, there is a large gap of whitespace at the bottom of my Text View. I am wondering how to clean it up to remove this whitespace using Interface Builder.
Simply change your bottom constraint to >= current value instead of equal and the UITextView will start resizing provided scrolling enabled is unchecked.
You just need to uncheck
Scrolling Enabled
Got the answers from here
Auto - Resizing
If you are using the auto-resizing for the text view then remove set the following setting for the auto-resizing tab.
This might be your settings, for the text view
Change it to the following setting,
Do not stretch the content of the text view,
And if you are worried about the content not displaying in the set height then that is not an issue, there is a already a scroll in the text view controller, make sure that is enabled.
Auto - Layout
If You are using Auto Layout in your app then set the constraints as shown in the below image on your text view,
Add these four constraints,
Left, right, top and the height of the text view.

iOS: Localised UIButton With Image and Title Label With Auto Layout

I'm wonder is there a way to make a button that includes UIImage and title label under the image using auto layout. I made this using title insets left with negative value. But, right now I want to add localisation to my app and, of course, title labels of my buttons won't be a constant value. I see the only way: calculate every insets for every button for a particular text (for every localisation). This is quite annoying.
Is there a way to replace insets with auto layout without separation of UIButton?

Centering a custom UIButton title with custom font

I'm using some custom fonts I added to my project for the titles of UIButton. I am not able to set my custom fonts in IB, and I've read in some posts that it is not possible yet in the last XCode version, is that right? So, currently, I'm setting the font for the titles programmatically. The point is that, as in IB the font is set to the default, when I set my custom font programmatically it is not centered, I guess because the font I can see in IB for the button has another height and width and this is the size considered to center the title. How could I center the title with my custom font?
Thanks!
Try this.
[button setContentHorizontalAlignment:UIControlContentHorizontalAlignmentCenter];
The problem came from the custom font, that it introduced some space below characters. This post solved my problem:
UIButton custom font vertical alignment

Resources