Static Table navigation in a Tabbar application - tableview

I am working in an Tabbar based app.
On the last of 4 tabs(More), I have a ViewController with a StaticTableView in it, embedded in a NavigationController which is in a Relationship View with my Tabbar.
Problem is that when I navigate to a new scene from any of these rows in the StaticTableView and come back (I have in every new scene a back button to the tab), I can´t see the tabbar at the bottom of my table !
Why ? Any idea ?

If you used storyboard you have to do this
http://imageshack.us/a/img805/2179/screenshot20130426at856.png
Sorry i can't post images!
Add:
Otherwise have to set the icon size 30x30 and 60 x60 so it does not look blurry. example home.png = 30x30 and home#2x.png = 60x60 for retina

Related

Xcode Storyboard - Table View doesn't expand automatically when dragged in

In Xcode 7.3, when I drag in a Table View from the Object Library to the Storyboard for a single view app, it doesn't automatically expand to the full size of the view. I seen it do that in my Udacity class videos and in other videos on YouTube. Is there a setting in Xcode that will correct this? Thanks.
Yes, you need to "pin" the tableView at the ViewController. Am I right you have a simple ViewController and add a tableView to it?
Now, you need to open the Pin Menu and uncheck the checkbox "Constrains to margins". Now you add the constrains to the top, left, right and bottom to 0 and save it. Now the TableView should stretch the whole display.
If you only show a table in the ViewController you should use a UITableViewController.

Trouble with UIScrollView and Constraints

I'm having trouble with UIScrollView and Constraints.
I want to display a FAQ inside my application. This will include several questions and answers, with various length. It won't change after launch, so I handle everything directly in the storyboard. However, it has to work on different iPhone screen size (from iPhone 5 to iPhone 6 Plus).
So what I'm trying to do is :
UIView
UIScrollView
UIView (FAQ1)
UILabel (Question 1)
UITextView (Answer 1)
UIView (FAQ2)
UILabel (Question 2)
UITextView (Answer 2)
...
Here is an example of what it looks like (color on purpose, to see at runtime) :
Now if I apply some constraints, I manage to get that :
However it is not scrollable and the text is out on the right side.
If I run the same thing on a smaller screen, I get that :
Which is scrollable this time (not more than what you see on the screenshot...) and the text is still out.
Is there anyone who could help me understanding how to use Constraints properly with an UIScrollView ?
If possible the text size has to shrink on small screens.
If it isn't, it should keep the same size but the UITextView will be scrollable too.
The best way to use scrollview and auto layout is to add a view inside the scrollview and pin all its edges to scroll view and equal widths to superview, Pin all edges of scrollview to superView
pin top, left , right and height of your label to your FAQ1 view.
pin top of your text view to label and left right and bottom to your FAQ1 view.
pin the height of your FAQ1 view, and left and right of your faq1 view to content view.
Follow step 1 to 3 for all your faq views.
Pin top of your faq1 view to top to top of content view
Pin the top of the next faq view to bottom of the previous faq view.
pin bottom of the last faq view to bottom of content view
when adding your faq1 view pin its top to top ,left and right to contentView's top left and right with necessary padding.
You can find the sample code here
Hope this solves your problem

UIPageViewController with scrollview odd inset bounce

Storyboard Screenshot
I wonder if anyone can shed any light on this for me.
I have a UIPageViewController as part of a SWRevealViewController structure as seen in the storyboard in the linked picture.
The UIPageViewController contains a series of UIViewControllers which have a vertical scroll views in them. The first page shows fine but when I swipe left to display a new page the view loads about 30 pixels to high and after 0.5 a second it drops down to the right place. After that when you scroll left and right it displays normally.
I have tried everything in this post so far and nothing has worked.
self.automaticallyAdjustsScrollViewInsets = false;
pageViewController.automaticallyAdjustsScrollViewInsets = false;
I am pretty sure it is something to do with UIPageViewController scroll inset but not sure what to do about it as I have tried everything I can think of in the last 3 days to try and fix this.
Thank you in advance
Not sure if this will help you, but I had a smaller 5px bounce issue scrolling images in a UIPageViewController. Nothing in the post you look through helped me either. But using a separate UIView as a container view between the individual page view controller's view and my UIImageView miraculously solved the issue for me.
So the hierarchy you want in your page's view controller's view is:
Main View
Container View
Your Actual view content

XCode Change Image From PopOver Navigation

I'm wondering if you can help me.
Basically we have a set of 16 images,
ImageA.png
ImageB.png ect ect...
That need to be shown by selecting it from a "Menu".
I want it to work like a split view controller, but I don't want to limit the width of the screen by having the navigation bar at the side, as the app must run in Landscape mode.
Here is the screenshots of what I have come up with instead of the SplitView;
http://i.stack.imgur.com/fdy21.png
The image is in a UIImageView,
And I have added a PopOver to the button that is linked to the UITableView.
What I want, is to be able to select an image from the PopOver Navigation, and it will change the image in the UIImageView to the corresponding.
Sorry if I haven't explained myself enough... I'm new to XCode!
Also: I am using XCode in Storyboard mode;
http://i.stack.imgur.com/RSuyY.png
Thanks,
Alex
To make the master view not be static on the side, implement this method in your UISplitViewControllerDelegate:
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
return YES from this method, and the split view controller will behave the same way in landscape as it does in portrait

Autoresize the root view when device is rotated

I am developing PDF reader. I am facing problem while rotating the simulator. What I am doing is, when view is loaded by the ViewController(i.e. in the loadView), I am creating the UIScrollView which contains UIImageView and UIView of the same size(i.e. size of the PDF page). It is working perfectly in the portrait mode. But when I rotate the simulator in the landscape mode, the view is not autoresized according to device. I have tried
self.view.autoresizesSubviews = YES;
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
in the viewDidLoad() of the ViewController
But it's not working. I am confused how the above two properties work. I guess these properties will autoresize the UIScrollView to the size of root view in which I am loading UIScrollView. But what should be done to autoresize the main view in which UIScrollView is loaded??
I've experienced the same problem when trying to utilise the auto resizing methods. So, I hope this will help. (P.S. I'm assuming you're creating the UI programmatically and not via IB)
So have you tried this?
Inside your viewcontroller add the following:
// Set the View Controller to fit the whole screen.
-(BOOL)wantsFullScreenLayout{
return YES;
}
Inside the loadView method amend your scrollView to:
// set the initial size of your scrollView object.
[scrollView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
// Set the auto resizing attributes.
[scrollView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
In addition to this you might need to set the autoresizingmask margins for either the UIView or UIImageView depending on the type of layout you require when the device is rotated.
This is late reply... It may help if you didn't Fix it yet.
When you create any app in portraid mode and if you want it to rotate (resize) to landscape mode, you should do it in User Interface Builder or .xib (or in Storyboard iPad or iPhone)file.
So to check or to check rotate in the Simulator:
Go to "USER INTERFACE BUILDER", or ".XIB" (or "Storyboard iPad or iPhone") file.
Then select "UIImageView" and go to "SHOW THE ATTRIBUES INSPECTOR".
In the fourth tab (Attributes Inspector) set the mode to “Aspect Fit”, and in the third tab (Size Inspector) and in the fifth tab (Size Inspector) set the autosizing attributes to the following:
Set the arrows to all directions. Sorry can't load image.
Do the same for "UIView" (3).
Before you move on, you can double check that you’ve gotten all of the autosizing attributes right by selecting the Detail View Controller, and changing the orientation from Portrait to Landscape: Sorry can't load image for now...
You can Check or Change to "Landscape or Portrait" on the top right side "Simulated Metrics" select under "Size" the "Orientation".
If something isn’t right, don't worry: Just change it back to Portrait and double check the settings.

Resources