I need font with centered plus sign - ios

Hello I'm making the Add button for my iOS project. It has to use material style, so i've found BFPaperButton project on github. Now I need to find font where plus sign is vertically and horizontally centered. I've try many fonts, but not all. The most suitable is Times New Roman. Maybe someone now better font for my goal? I think if UIBarButton System items have their font - Add symbol has to be suitable, but I can't find it.
P.S.: Text in button centered
Here is an image of what I already have.
https://pp.vk.me/c622128/v622128875/1e805/D5K67mtyA50.jpg
And what I have to make
https://pp.vk.me/c622128/v622128875/1e80c/y0_W11kTl-0.jpg
P.P.S. I'm sorry for my English, I'm trying to write question without any translators.

Just used
contentEdgeInsets = UIEdgeInsetsMake(-12, 0, 0, 0);
It helped.

Related

iOS - swift 3.0 : When the input language is Arabic, UITextField is still showing the caps lock indicator

iOS - swift 3.0 : I am developing an iOS app with English and Arabic languages. In my password text field, which is in "secure text entry" mode, when I change the text input language of the keyboard from English to Arabic, it is still showing the caps lock indicator. I am not able to figure out any solutions for this strange issue. Pls help me out. Thanks in advance.
Note: I am not able to even reproduce this often, but my client reports this bug.
I am totally clueless. Looks like iOS bug?
Okay, assuming that the Arabic keyboard basically has no shift key (and further assuming that having pressed shift before on its English counterpart doesn't actually modify the input, i.e. it's just a graphical glitch) that sounds like a bug on Apple's part.
According to this answer (which is dated, but I assume still valid) you can't really change anything about the keyboard programmatically in this sense. I.e. you can't press a button like shift in code.
If it's really just a graphical issue and you can figure out when exactly the icon should disappear, you can work around it by overlaying your own image over the button (e.g. a white square to hide it), like so. I don't know which event or delegate method would immediately happen before the image needs to be set, though, you will have to figure this out with your users.
I'd furthermore suggest filing a rdar for Apple if it's really just a graphical issue.
Finally, I came up with a solution to hide the caps lock indicator of the textfield when it is in secureTextEntry mode.
//-------To hide caps lock indicator------//
let v = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
self.passwordTextField.rightView = v
//----------------------------------------//
Basically, the caps lock indicator is presented on the right view of the UITextFiled by default, when the textfield is in secureTextEntry mode.
By assigning a view with zero dimension to the right view of the textfield , it just overrides that view with the new view(which has zero dimension) , hence the caps lock indicator never appears there after.

TextView's font i not changing in storyboard

as you can see in the above i'm trying to change my textView's font , but it didn't changing i searched some related terms on changing for like this one
and this , but nothing worked for me
i'm also not sure if this is the correct name of my desired font or not
titleTextView.font = UIFont(name: "Myriad-Condensed", size: 25)
even in this site they dont have anything related to my desired font which is Myriad pro Condensed according to storyboard's attribute inspector
anyone faced anything similar to this before ?? or any clue what i should do ? then please let me know
First you need a font to use. Download any of them in you cass its right here : http://ufonts.com/fonts/myriadpro-cond.html
After downloading drag & drop the font file (otf or ttf) into your project
Make sure you check the box next to your target or the font won’t actually get included in your app (even though it’ll probably show in Interface Builder).
Open up the Info.plist . Add a new array of strings to it: “Fonts provided by application”. Add the filenames for each font you want to use as String entries in the array. (That one ttf file you just added to your project )
Now you're good to go , select that font once again like you did in the attached image.
For more detail see this article https://grokswift.com/custom-fonts/

UITextView fix character width

My problem is that I have to two UITextView displaying different Text, but always the same number of characters. I could not find a way to set a fix character-width and space width in UITextView/NSAtrrStr/UIFont.
Is there a way to do that?
thanks
As far as I know, Courier New is the only fixed-width font shipped with iOS.
Also, you can always import custom fonts to your xcode project which you know are fixed-width. Here is how: Embed Custom Font in iOS

Can't change font in XCode 6.1.1

Within XCode 6.1.1 I'm unable to change the font on my label within my storyboard. I can set 'Text' to either 'Plain' or 'Attributed', but then [T] next to Helevetica Neue 17.0 appears grayed out, and it does not do anything when I click it. This happens in all of my projects.
Screenshot here: https://i.imgur.com/3VOSsVn.png
Thank you!
Edit: Unfortunately none of the answers below have answered my question yet. The [T] is unclickable.. it is grayed out so I can't change the Font to custom under there. And while I could go in and enter code to change the font, I would prefer to do it through the GUI.
This problem was driving me crazy - your workaround works for the normal storyboard, but not for the Watch storyboard which has a custom fonts popup.
I finally found this page:
https://github.com/synergy/synergy/issues/4109
It's a bug with using Synergy - I connected a USB mouse to my Mac and when I click the font "T" icon with the USB mouse, it works!!!!
Actually, you have to first select a syntax category in the detail area. You can press CMD+A to select all categories. Then you can click the "T" and select a new font.
See here: https://developer.apple.com/library/ios/recipes/xcode_help-fonts_and_colors_preferences_help/Recipe.html
In the "font", change "system" to "custom”
You can set font for labels in two ways- programmatically and in storyboard.
In your storyboard, you need to click the little T and then select the wanted font.
In your code, assuming you already set the appropriate IBOutlets, you can use something like
[self.theTextLabel setFont:[UIFont boldSystemFontOfSize:17.0]];
Tap on the "T" sign next to the already assigned font, then change "system" to "custom”. Once the settings are on custom the font can be changed as well as it's weight (ie. light, bold...)
I did find a workaround... I can bring up the font menu by crtl-shift-opt-T and change the font there and changes I make are reflected on the page... but the [T] is still still grayed out for some reason.

Label and NSTimer shadow design

I'm a beginner in iOS and need some leads to do something that don't feel that easy to do ...
I have to change my design for a timer (elapsed time and remaining time) that looks this way :
To something that look this way :
Would you have any leads to give to me (except for the shadow color and offset properties that I already know) ? My principal guess for now is : How differentiate these 2 states : gray when no time and blue when there is.
Thank you in advance !
You're new to iOS development, so i'm not sure if it's a good idea to throw some 3rd party framworks at your head! but anyway, take a look at TTTAttributetLabel. I'ts a drop-in replacement for UILabel and lets you style the parts of a UILabel text differently, so it could fit for your needs above!
Download the framework from the given link and look at the example project provided with it. And don't forget to include the CoreText framework into your project. (see "How to add existing frameworks in Xcode")

Resources