UISearchBar as UINavigationItem.rightBarButtonItem in Interface builder? - iphone

I know you can create a UISearchBar, put it in a UIBarButtonItem, and set that as the rightBarButtonItem in code, but I was wondering if there was a way to do that in IB now? Thanks!

You can place an UIView inside UIBarButtonItem. You can then place any UIView subclass into that UIView as subview.

Related

Make UIView work like a UIButton

I built a Custom Cell in IB and in it created a view that represents a button. It has Labels and ImageViews in it.
I want to know if there is a way to make that view act like a button. That is, show a shadow and call a method when is pressed.
Yes. Just implement tableView:didSelectRowAtIndexPath: and you can do everything you could do in a button action #selector.
As for the shadow and the rounded rectangle button feel, if you use a single cell in a section with UITableViewStyleGrouped, it will be pretty close.
The best is to make it a button. You can use UIButtonTypeCustom and set the background to the cell you've created.
You can use UITapGestureRecognizer and pass the event through a delegate or use UIControl which is a subclass of UIView but with UIButton tap events like touchUpInside and so, and then pass the event with a delegate to your view

custom delete button uitableview iphone sdk

I wanted swipe a custom view into a UITableViewCell. I can set and use the swipe delete button but I want to have the same effect with any view.
Have you tried setting
#property(nonatomic, retain) UIView *editingAccessoryView
of UITableViewCell?
Why don't you try it will Custom cell & each having the UIView in cell.
That would be much easier way to manage if there are multiple view & user will also be able to scroll for all view.
Hope this trick would work .

Is it possible to have other UIControls on a UITableView?

I have a UITableView with 3 sections inside of a UIViewController. Is it possible to have other controls above the UITableView for example a UISlider or a UIImage? If so, how can this be accomplished?
Note: These controls should not be in a UITableViewCell, they should be part of the view.
Yes, you can add a UIView to the table header or footer, see the tableHeaderView and tableFooterView properties. A UIView could be a UIControl or a view that contains UIControls.

How to make a UIView that is aware of highlight?

I want to make a uiview that can be aware of highlight status, like a UILabel is when put inside a UICellTableView.
Subclass UIControl instead of UIView.

How to do UITextField's leftView in Interface Builder?

Looking at UITextField item in Interface Builder, cannot see any way to set leftView property. Would like the put there an icon to show user that this is place for text input.
The overlay view displayed on the left side of the text field.
#property(nonatomic, retain) UIView *leftView
Can it be set using IB at all?
You mean UITextField? It looks like you cannot do that in IB. Instead, somewhere in your view controller's -viewDidLoad set both leftView and leftViewMode properties.