Display n as subscript [duplicate] - iphone

This question already has answers here:
How to create subscript characters that's not in Unicode in iOS
(3 answers)
Closed 9 years ago.
I want to display n as subscript in my app when i am using unicode character for it a square is displayed on my simulator.
want to display "bn" here n must be at subscript.this might be a basic question but i cant resolve this issue as i am developing my first app. please help me out of these
Thanks in advance..
the code i tried is
NSString * strstatic=#"\nb \u2099;
GenEqn.text=[NSString stringWithFormat:#"Your Equation is ==> %#",strstatic];

I would open up OS X's character viewer and drag the character straight into Xcode. It turns out it actually works!

You can only use characters that are available in the font you're using. You'll either need to change font to one that has the character or change the character you're using.
Check this for adding custom fonts: Can I embed a custom font in an iPhone application?
Alternatively use NSAttributedString (Possibly with a library like DTCoreText depending on what versions of iOS you need to support) to specify the the text layout / formatting.

Related

UIFont.fontName in iOS10 doesn't return "regular" suffix

After a successful migration to swift 2.3 in my application, I found a font glitch.
I have an extension for UIFont where I change system font to my custom font.
In iOS 9 and earlier everything worked as expected. In iOS 10 it doesn't.
The problem was in self.fontName. Normally it should return "fontName" + suffix for style (ex:regular, bold, etc).
However in iOS 10 for regular the style, it doesn't return suffix only "fontName".
I googled to found why but couldn't find anything.
The problem is fixed but why this happens I don't know. Any idea?
Using font names has never been a good idea.
Use fontDescriptor and inspect the UIFontDescriptor's fontAttributes and symbolicTraits to obtain information on the font in question. You can then create a new descriptor with modified attributes and/or traits, and obtain a font with that descriptor using init(descriptor:size:).

How to set small image symbol in application's name under Application icon? [duplicate]

This question already has an answer here:
Additional Icon in App Name/Lable
(1 answer)
Closed 9 years ago.
I had install the ipad application as shown in image. And there's raise a question, that how to set special sybolic application name with image ? as shown in image. It will be good to know how to make it.
Thanks,
K.D
i just study it and got the Solution at your Info.plist file --> BundulDisplayName-->DoubleClickOn Right-side at as bellow Image:-
Now just Clear ${PRODUCT_NAME} And select Edit at upside Tool bar like bellow image:-
then now you can see the window like:-
Now Drag symbol from characters windows to BundulDisplayName when you put this special Symbol then put name of display you want of app then again drag second time same process after name put second symbol.
that's it now save and run your Project your icon look like:-
hope you getting you want :)

(Codenameone) Blackberry TextField Missing Border When Focusing

I want to ask why the border of TextField in Blackberry (CodenameOne) always missing when focusing? I am using Native Themes and I have try with theme builder to change the attribute (TextField Background, border etc..) but still missing, does anyone know how to make border on the TextField still appear when you type something in the TextField? Thanks for your help
PS: This does not happen on LWUIT Thorsten Blackberry 1.4
If I recall correctly Thorsten's port doesn't use in place editing for input.
During input the native text field border is used, there is very limited control on the native input.
I have used LWUIT for some years in BlackBerry and yesterday I was facing the same problem. What I did:
Make my own version 1.5 using the things related to TextField and focus from 1.4 (BlackBerryTouchImplementation.java and BlackBerryTouchSupport.java and some little changes).
I did it because I found 2 problems more:
1.The textField were ignoring addDataChangeListener.
2.With constraints PASSWORD | NUMERIC in a TextField, the cursor doesnt move from the first place, I mean, you can enter 8 digit (qwer1234 because it's ignoring the constraints, input mode, input mode order) and the cursor is in the left side of "q".
I know that Shai Almog probably dont like it but let me tell you that I have made test on these BlackBerry devices: 9330, 9550, 9700 and all is ok.
I have been developing a big one app for around 4 months for Spanish language and the quality team have not found big problems.

String with different font

I am having a string message i need first word of that as bold font and rest normal.
Making different label can be create problems,(need to find the size of first the make other and then make other,text is in 4 line).
How can i use NSAttributedString here. I could found How do you use NSAttributedString?
but using this shows undeclared NSForegrou... (present in app kit framework).But could not found app kit framework on sdk 4.2
Need help for making such kind of string(bold + normal text).
Go through the below blog tutorial with code, they have different font with NSAttributedString.
http://www.cocoanetics.com/2011/01/rich-text-editing-on-ios/
https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML
https://github.com/omnigroup/OmniGroup/tree/master/Frameworks/OmniUI/iPad/Examples/TextEditor
May I point you to the CoreText Framework and Befriending Core Text on cocoanetics.com. This will show you how to format text.

How do I display a NSAttributedString on an iPhone? [duplicate]

This question already has answers here:
iphone/ipad: How exactly use NSAttributedString?
(9 answers)
Closed 9 years ago.
I believe I understand how to set NSAttributedString values but how on earth do you actually display them in the interface?
examples: UILabel, UITextView, etc.
Specific instructions would be greatly appreciated/
Thanks!
you could also create a CATextLayer, which works fine with attributed strings...
Just create the layer, and set it's string property...
Have fun... :D
If you don't want to bother with CATextLayer, you should check out TTTAttributedLabel. It's just like UILabel, except that supports NSAttributedStrings (using the same setText: method as UILabel, so you can use it as a drop-in replacement)
In iOS 6 and later you can use attributed strings to display formatted
text in text views, text fields, and some other controls. Both AppKit
and UIKit also define extensions to the basic attributed string
interface that allows you to draw their contents in the current
graphic context.
NSAttributedString Reference
The controls you mentioned only work with strings, not attributed strings. The only way to display them is to do a lot of work with Core Text. File a complaint with bugreporter.apple.com to request they flesh this part of UIKit out.