UIButton with custom font and text outline/stroke - objective-c

I've got a huge problem, I need to make a UIButton with custom font and text outline. Custom font is pretty easy to make and I have no difficulties doing it, but I don't know how to make an outline for button title. There are some solutions for UILabel (overriding drawTextInRect) but UIButton has no such method. Help would be appreciated!

Just put the customized UILabel on top of a blank button.

Related

UIView with button below

My question is easy with this drawing :
I have a view above the blue stroke. We can see the buttons behind because this UIView background image is transparent at the left of the button.
My problem is that buttons, behind the views are not clickable.
Is there a way to make them clickable (without playing with adding or removing the view above) ?
Thanks !
Regards,
Sébastien ;)
try to set the
[viewAboveTheBlueStroke setUserInteractionEnabled:false];
because normally the UIView steals the event handling from the other views what it covers (i.e your buttons) and it won't pass them after.
Your image link is broken.
However, you could set the buttonType of your UIBUtton to UIButtonTypeCustom
and then bring them to front:
[self.view bringSubViewToFron:myBut];
You could also consider add UIGestureRecognizers to your image in front instead.

UITextfield not expanding in uitableviewcell

Could somebody explain how to make a UITextField within a UITableView cell expand vertically. Right now when I add text to the textfield it expands infinitely but in the horizontal direction. Is there a way to have the textfield use a fixed width and expand vertically? If there is could somebody provide sample code for this kind of functionality?
The answer would be to use a UITextView, not a UITextField.
Check this out - I created a tool that makes a uiview which holds a clickable/expandable uitextview. You can use this, set the size of the containing cell accordingly, and overwrite the functions that change height programmatically.
It's not exactly what you wanted, but it might help!
https://github.com/AlphastudioNJ/nicktitle-ui-tools/tree/master/GrowingUITextViewer

How to add comment box to page?

I am trying to model my "add comment" interface with what you see in the diagram below. However, I was unable to find such a UI element in the XCode library.
Is this a customized UI element? Or can I find a UI with the same look and feel as what you see in the diagram?
You can approximate it using a UIImageView (the silver gray background) and a UITextView on top of it which has a proper cornerRadius set. You'll need to:
#import <QuartzCore/QuartzCore.h>
in order to be able to set the cornerRadius property of the UITextView like this:
textView.layer.cornerRadius = 1.0f; // play around to see what gives you the above rounded effect to your needs.
Assuming you just want the textfield shape, you can use a UIImageView as background and have a textfield or textview on top of it accordingly...Now if you want that textview to expand thats another story, you can use strechableImageWithleftCapWidth: method on the image in order to be able to strech and expand it, and then you would need to create a custom UITextView class that expands as characters are typed in...

Question about these UIButtons

How can I get a UIButton like the ones at the bottom of this picutre (move and delete)? Specifically, I want an image with a text just like that. http://4.bp.blogspot.com/_QLwms0mVa4w/SQN0MqPIpXI/AAAAAAAAAA8/lEikKn9eP_0/s1600-h/Screenshot+2008-10-25+15:31:21+-0400-1.png
Thanks.
For Jason:
The image sticks right beside the label. Is there anyway from IB I can set it to align to the left, while the label aligns to the right? Here's what it looks like right now:
What you can do is in Interface Builder, the UIButton can be set to a type of "Custom"
After you have done this, you can simply use your own image for the button and different images for each state of the button.
Although with this approach you won't be able to have additional text modified on it like the mail app has with "Delete (1)". However, if you don't need that then this solution will work for you.
Alternatively, if you just want an image stuck onto your existing button then there is an Image property in Interface Builder where you can slap on an image to your button.
If you need more functionality then you would probably have to create your own UIButton by subclassing to handle it.

Add UIButton to UITextView Dynamically with UserInteractionEnabled

I am building an app where I need to add buttons to a UITextView dynamically on the basis of text entered by the user in the same UITextView.
The look I want to give is something like To field in message app of iPhone
I am unsable to figure out the way to do the needful.
Any help would be highly appreciated.
Thanks in advance!!
I found out the solution to my problem and no one has yet answered here so will reply to my own question.
I tried to keep a UITextView on a UIScrollView and then kept changing the width of the UItectView and added button to the left of it depending on the text added in the the textView. This will help in giving an appearance similar to that of a textfield with dynamic addition of UIButton.
Hope this wolrs for all those having the similar problem.