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:
Related
I have n UIView above my UITableView.
I would like to have the UIView moves up as if it is "pushed" by the UITableView when user scrolls.
I am wondering how do we create an effect like this?
SCREENSHOT - Before User Scrolls
SCREENSHOT - After user Scrolls, Please notice the UIView above it (Offers, Discover, Most Booked)
The view with 3 buttons needs to be taken as the header view of table. Take the outlet of that view.
[tableView setHeaderView:yourView];
You need to set this in the viewDidLoad of your view controller.
I'm newbie with iOS and asking for direction.
I want to make a page which contains navigation buttons on top and when tap load different UICollectionView's as you can see on the app screen taken from "Fancy". Also buttons line have to be fixed on top while scrolling down. (just like in the screenshot)
Which is the right approach?
Base class to be UICollectionViewController and adding as SubView
Using UIScrollViewController?
etc...
Thanks in advance.
Base class should be UiViewController implementing UICollectionViewDelegate
UIViewController <UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
Create different NSArray for each Category of your project as datasource of UICollectionView
use UISegmentedControl for switching the datasource of UICollectionView and reload UICollectionView to display different content.
You can customise your Segmented Control as you wanted.
Implement UITabbarController for the bottom bar to enter any other views
There are a number of ways to go about this. The simplest would probably be to use a UIViewController subclass whose view contains a UISegmentedControl subview (for the navigation controls) and a UICollectionView subview for the content.
If I use a UItableViewController it works fine but I need to use a UItableView inside a UIViewController instead. My question is, do i have to manually program it to add extra space at the top and bottom so the first and last cells won't be partially covered and how would I move the refresh indicator down so that its not covered?
Make sure your table view is added as the first subview of your view controller. This will ensure its scroll insets are setup properly.
Also be sure to set the table view's frame to match the bounds of the view controller's view and be sure to set the autoresizingMask to flexible width and height.
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:
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.