I tried to add UIButton in UITableView below UITableViewCells using storyboard.
However, the button width filled the whole area. I could net reduce the width of UIButton using storyboard. Do I have to add it programmatically?
I'm trying to active a result similar like the button in Viber setup, as shown below.
By adding the UIButton directly at the end of your table view, you're making it the table view footer, and the table view footer is required to take the whole table view width.
Try replacing your UIButton with a UIView, and add the UIButton in this UIView:
Related
Good day,
I have a question about programmatically adding UITableView inside UIScrollView. The structure is like that:
UIView
UIScrollView
UIView(contentView)
UIImageView
UITableView
How can I add the UITableView programmatically inside UIScrollView so when I scroll horizontally to switch between UIImageView and UITableView. Note I am using Autolayout so I need to add constraints also. If it is going to be easier with storyboard please let me know how to do it with storyboard instead of programmatically
I used SwipeView it is pretty easy to use 5 minutes installation and did what I was looking for.
I have a UIPickerView on a scrollable view with multiple buttons and textfields. UIPickerView picks values into two of the text fields. Now, the problem is UIPickerView is also scrolling along with the page. Can any one guide me how to keep the UIPickerView at the bottom and opaque on a scrollable page?
You need to add the UIPickerView to the superview of the UIScrollView (possibly the view property of the UIViewController that you're working in.
You might also want to extend the contentSize property of the scroll view by the height of the picker view so that all objects in the scroll view can be scrolled on screen and aren't hidden under the picker view.
Take another View on the top of the scroll view and put your UIPickerView into that so it is now independent to your UIScrollView like this:
I'm working on an interface prototype and am using a storyboard to do so. Part of the prototype involves setting the detail UILabel for UITableView cells to a certain color. I would like to avoid having to manually recolor every label within a storyboard.
I found that I can use:
[[UILabel appearanceWhenContainedIn:[UITableViewCell class], nil]
setTextColor:[UIColor cyanColor]];
To change the appearance of labels within tableview cells. Is there a way to further refine this code to only apply to detail tableview labels? Currently it changes both textLabel and detailTextLabel of UITableViewCell.
Thank you!
You could trick around this by subclassing the cells in the detail view, then use
[[UILabel appearanceWhenContainedIn:[YOUR_UITableViewCell class], nil]
setTextColor:[UIColor other_colr]];
If you want to keep using the appearance proxy, you will have to create a custom table view cell and a new label.
In the storyboard editor you set the style property of your UITableCell to "custom".
Drag two label to the table view cell and configure it like you want it.
Create a new class that inherits from UITableViewCell and make IBOutlets for every label.
In the storyboard editor you set the class of the table view cell to the table view cell class you just created. Connect the outlets to the labels. Actually this is enough, because you can configure the appearance of the cells in the storyboard as well. If you want to configure the label through code you have to execute the following steps as well.
Create a new class that inherits from UILabel and leave it as is.
Go back to the storyboard editor and select the detailtextlabel and change the class to the label class you just create.
If you want more information on how to create your own table view cells see Table View Programming Guide for IOS
I have a UITableView that I populate with cells in the normal fashion using the datasource and delegate. I would like to add a custom subview, that does the following:
1) scrolls with the UITableView
2) is seen beneath the UITableView scrollbar
3) can be moved and animated independently of any cell (acts as a selector that animates from one cell to the next)
I know how to animate a selector over the top of the UITableView, but that violates requirement #2 (it makes the scrollbar look terrible)
Has anyone seen an implementation of this, or know the proper way of doing it?
Did you try something like this?
Have a base view.
Add your custom subview to the base view.
Then add your table view on top of it to the base view.
Implement the table's scroll delegates and move the custom subview.
Thinking at the top of my head, couldn't you disable the scrollbar for the table view and place a transparent scroll view with the same dimension as the table view on top. You're effectively using the scroll bar of the scroll view instead of the table view. You'd scroll the scroll view in step with the table view.
Look at this image:
alt text http://img139.imageshack.us/img139/4488/picture2ep3.png
I know how to add UITableView with grouped style and how to add label in any table cell.
But how can I add image and labels on top on the view, like screen.
Using Interface Builder, you can just drag these (UILabels and UIImageViews) onto your view. If you're using a UITableViewController, you might want to switch to a standard UIViewController, to give you more control over what goes into the view.
After you've dragged them on, hook them up via outlets (if you want to programatically change/access them) or set their contents in IB and be done with it.