Draw lines on UITextView and align the text accordingly - iphone

How can i draw lines on UITextView and set text accordingly. I got this idea from this link. But not clear how to implement this thing. I don't have much experience in this.
Please guide for above.
Thanks in advance.

It uses NSLayoutManagerDelegate, that is used in ios7. For iOS 7, the styleString approach no longer works. You have to use NSLayoutManagerDelegate, it is easy to use. check this link.

Related

Some Border Types in NSImageView Not Appearing

I've looked in previous posts in SO and elsewhere for an answer but no luck. I'm putting images in an NSCollectionView as well as just a single image itself but the only border that seems to work is the grey Bezel border. Other types that are available don't show up, like Button or Groove. This is true no matter what scaling option I use, or even if I use it in code. I'm using NSImageView.imageFrameStyle.
I hope someone has some insight into this. I didn't provide any code since I didn't think that's necessary. Using Xcode 10.1, Swift 4.2. Thanks for any help.

How do I set the background image of a UISegmentedControl

I have a view with a segmentedcontrol in it and I would like to set the background image of that control. I know that I can change set the tint color, but I want more control over it than that. So if I could set a background image that would be cool.
I found this tutorial on how to achieve this, however it's outdated, and I'm unable to get it working.
Could anyone please help me? I greatly appreciate any help.
UPDATE
Half the solution has been found, if the only thing one needs to support is iOS5 you can use setBackgroundImage:forState:barMetrics:. A great tutorial on the matter can be found here.
How about this?: setBackgroundImage:forState:barMetrics:
Straight from the docs
Note: Available in iOS 5.0 and later.

editingRectForBounds: how to implement for UITextField

I am attempting to adjust the margin on a UITextField, and i have done a bit of research and found that i need to use editingRectForBounds: While that should be helpful to most people I find that I need a bit more guidance to make the nessesary code changes. Could someone please point me in the direction of a tutorial or maybe write out just a quick couple steps how i might use editingRectForBounds: to adjust the UITextField text?
Ive seen this, but am not sure how to make it work.
Thanks for the help!

Where can I find some beautiful iPhone buttons?

Don't need image background, just good-looking color is enough.
Jeff LaMarche has some very iOS-looking and simple-to-use programmatic gradient buttons here.
You just need to add a .h and .m file to your project and you are good to go.
http://www.youthedesigner.com/2010/03/10/29-sexy-iphone-app-designs/
http://www.smashingmagazine.com/2009/10/09/iphone-app-design-trends/
These may not be of any use but check them out. There are some really well designed apps and u'll get a good idea of what colours work. Your question is slightly vague to provide an exact answer IMO.
You can get the RBB values of the colours using a number of tools.
Check this
Fun With UIButtons and Core Animation Layers

How do i change color of letters of sectionIndexTitlesForTableView?

Hope you all are fine and also in best of your moods.
I have a little problem kindly help me to get its solution.
my Problem is:
I am using vertical search in my application, using method sectionIndexTitlesForTableView() of tableview i get all Character listed from top to bottom at rightside.
But this letters have fixed color. i need to change this color. Since i newbie i don't know how to deal with it.
Please help to get solution.
Thanks, and sorry if you found me with wrong english.
There is no supported way to do this. Even if you had access to the index view (which you don't easily), it would not be possible because there is no NSAttributedString on iPhone, so you couldn't return color information.
The best way to achieve this is to turn off the tableview's index and generate your own from scratch, floating it over top of the tableview. But I would not recommend this approach for a new iPhone developer. It is best to spend some serious time learning to build UIs the way Apple intends you to. Once you understand Apple's UI and how it's implemented, then you can make informed decisions about whether you should break the UI rules.