I am trying to storyboard a fairly basic app. It has a tableview with some group cells. One of those groups I want to be a 'Clear' button with a red gradient background. Look at email settings, for an individual account there is a 'Delete Account' button that is a red gradient. What is the correct to add this to a table view when using storyboard.
What I have tried:
1.Just a normal table cell. This is not really a button although I could listen for a select on that cell.
Change the cell to custom, and add a button to the table cell. I have to change the button to a custom button to get the border to hide.
Add a button to the bottom of the table view. Issue here is that the button is wider than all the table cells.
Is there an easy way, or at least a right way to get a button that is the same size as all my table cells with a red gradient?
Added a screen shot of an example for the mail settings panel.
Drag and drop a view to bottom of your tableview, then drag and drop a button inside of that view.
You can resize that button like any other button, in button settings just choose your image file for the background of the button
EDIT::::
If you want them to be same background connect your view to a outlet and change the backgorund to same color:
#property (nonatomic, weak) IBOutlet UIView *lowerView;
#synthesize lowerView;
- (void)viewDidLoad
{
self.tableView.backgroundColor=nil;
self.lowerView.backgroundColor=nil;
}
Related
I have added cross button on the edge of collection view cell and half part of this button gets overlapped by the cell below it. How can I make the lower half for this button tappable?
Edit:
Is there anyway we can change the zposition for button or we can make it appear above the collection cells?
I have a custom table view cell with UILable and UIButton which is working fine I am getting proper event on button tap, but the issue is tap effect of button is not visible in UI.
Edit - Functionality wise button is working fine but the issue is that on tap, tap effect is not visible see below attached image.
I am expecting below same smooth touch for button which is within tableview Cell -
add this on your button showsTouchWhenHighlighted and check once
button.showsTouchWhenHighlighted = TRUE
You can set the Text Color e.g Light Gray Color for the button's highlighted state in storyboard.
It will give a tap effect to your button.
Here's my setup: I have a ViewController that contains an image(button). This button takes the user to another viewController using an #IBAction func (tab controller tab). However, I also want a scrollView on the initial ViewController, just under the image button.
What I'm trying to achieve is the ability to scroll content on top of the image button as if it were another page on top of the image button. As the user scroll back down, the image button is revealed underneath the scrollView and is clickable again.
I can't seem to find a solution anywhere online. My scrollView is either fixed below the image button, or covers the image button rendering it unclickable.
Here's a screenshot
take a look at the demo project i set up:
https://github.com/slotti85/ButtonAndScrollView
i...
put the scrollview all over the screen (also over the button),
set up a contentInset to make the button visible initially,
subclassed UIScrollView and
overrode the pointInside function to make the scrollview forward a touch if the "transparent area" is tapped.
hope it helps!
I am started to learn iOS. I am doing small app. In that I placed UIPickerView and UIButton in ViewController. On view controller tap, UIPickerView will show to the user. On showing, the detail, UIButton also show (overlay on UIPickerView). How can I Put the UIButton back to viewController.
How to avoid inappropriate view.?
See the update button in UIPicker view
this depends on the order you add your subviews to your view. try [viewController.view sendSubviewToBack: yourButton]
in interface builder drag the view you want to place on top of your view hierarchie to the bottom. on the picture UISegmentedControl would overlap the UIButton if not properly aligned.
Go to your xib file and drag your Picker object to the bottom of its container as in the image below:
I have a dynamic table view in iOS 6. The table view cells have the subtitle style and show an image, a title and a subtitle.
The table view is inside a navigation controller, and in the navigation bar I have a bar button item which allows you to reset the progress information shown in the subtitle of the cell and in the image shown in the cell (grey image when progress is 0%, orange when bigger than 0%, green when 100%, the actual percentage is shown in the subtitle).
When the user presses the reset button, the image is replaced by a special image (a rounded arrow) which, when pressed, would allow the user to reset the progress and start the exercise from scratch.
The trouble is the image view in a cell is clickable but I cannot distinguish between a click in the image and a click in the text part of the cell (title+subtitle).
How can I do this? I'd better subclass and add a button, which is clickable?
Another consideration is that maybe the round arrow that resets should be an accessory view and appear on the right?
I would just use UIButton and add a custom background image. That should work, as you mentioned.