I want a different title to appear in the navigation bar for each imageview in my scroll view (xcode 4.2, iOS 5.0) - ios4

I have a scroll view, and when a user moves from one imageview to the next, I want the title in the navigation bar to change. So I want to set a new title for the navigation bar for each image in the scroll view. How would I go about doing this?
Thank you very much for your help.

Write a delegate for your scroll view. In the delegate, implement the scrollViewDidScroll: method to figure out which image is currently visible and change the title.
To eliminate your incompatible type warning, you can declare that ScrollViewController adopts the UIScrollViewDelegate protocol:
#interface ScrollViewController : UIViewController <UIScrollViewDelegate>

Related

iOS 7 - ContainerView with embedded UITableViewController and UISearchBarController

I've a simple view which is embedded in an UINavigationController. This view contains a segemented control in it's top bar and a ContainerView as subview.
The content for the ContainerView is a UITableViewController with a UISearchBarController.
I've set EdgesForExtendedLayout to none for both controllers.
After first start it looks okey:
After tapping the first time into the search bar - the bar is hidden behind the navigation bar:
After tapping outside a small part of the search bar is visable (grey border):
If I drag down then it looks like that:
After changing the view (push and pop on UINavigationController) it looks like that:
Any ideas to fix this?
I guess you want all your view to scroll, and not only the UITableView.
I'd embed everything in a UIScrollView (segmentedcontrol and tableview), and make sure the tableview doesn't scroll by itself.

How to add an view on top on activity layout dynamically which automatically shifted the old view down

I am working on an App in which I have an icon on Action Bar.When I click on this Action Bar icon then an EditText should come on the top of layout(below Action Bar) and all of the other data on layout should shif down.I am using Relative Layout.
I know how we can dynamically add view in relative layout.But here I have to add item on top on layout, while there is also some view on top before clicking the icon.
Try the below if it works for you, this is what you'll need as per my understanding of your question.
EditText et = new EditText(this);
empty.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
et.setText("Dynamic EditText!");
et.setMinLines(1);
et.setMaxLines(3);
relativelayout.addView(et);
// assuming you already have your relative layout and the rest declared.

Why no back button on DateElement picker?

This walkthrough for MT.D shows a back button on the UIDatePicker that appears when a DateElement is tapped. I'm in an iPad app, and using an MT.D DialogViewController as a subview in an overall UIView. When the date picker slides up I just get the black background with no way to dismiss the picker (no nav bar w/ back button). Same problem exists for the radio group picker. Is this because the dialog view controller is being used as a subview? Any ideas how I might get a nav bar up with a back button using the built-in picker logic?
You must use the DialogViewController as a child element of a UINavigationController to get the back button. On iPad, you can embed the UINavigationController in a UIPopoverController.
Adding the view of a controller into the view of another controller is not considered good design on iOS and won't result in the behavior you expect.

MonoTouch Dialog add a toolbar at the bottom of the dialog

I am trying to add a Toolbar that is anchored to the bottom of a MonoTouch Dialog.
Here is an example:
So as you scroll, the table's contents scroll but the toolbar at the bottom remains in view always. I know how to do this by using the interface builder, but no clue as to how to do this with Mt.D. Please please tell me it can be done!
To do this, it's probably easiest to use the DialogViewController and its View as a child of another UIViewController.
Just create your public class MyViewController : UIViewController class and then create and size your child views in the override ViewDidLoad method.

Show Title in MonoTouch tabbed application

Maybe I'm missing something super simple, but I can't seem to get a title to show up at the top of Views contained within a basic tabbed application. I follow these steps...
New Solution, Universal Storyboard, Tabbed Application
Run that and you have two basic Views "First View" and "Second View".
Neither View by default has a title bar, but the default code shows setting a this.Title.
Why don't the title bars show up? How do I get them to show? I've tried several things to get these to show such as...
Setting "Top Bar" in Interface Builder to "Navigation Bar". It then shows in Interface Builder but never shows on runtime.
I've also tried in ViewDidLoad() to set this.TabBarController.Title but that doesn't seem to do anything either.
Thoughts?
The feature you are looking for is called a NavigationBar and can be added manually via IB to your view if it does not have a NavigationController associated with it. If there is a navigation controller then the NavigationBar will show up automatically.
So to answer your question if you want a NavigationBar go to IB and add one from the objects library you should then be able to manipulate the Title on the nav bar to your hearts content.

Resources