uinavigationbar

Resizing UINavigationBar on rotation

主宰稳场 提交于 2019-12-05 04:38:25
I have a subclass of UIViewController which handles a UIView. The viewcontroller is presented modally (it slides up from the bottom of the screen). At the top of the view, i have added a navigation bar. Note that this bar is not handled by a navigation controller. I want to get the navbar to shrink in height when the view rotates to landscape (similar to how it behaves when it is handled by a UINavigationController). However, I can't set its autoresizing mask to flexible height in IB, and doing so in code causes the navbar to disappear completely. Is there a way to do this? How is it done by

Add items to menu dynamically in asp.net website

霸气de小男生 提交于 2019-12-05 04:23:01
<asp:Menu ID="mnu" runat="server" PathSeparator="," CssClass="menu" DynamicMenuItemStyle-CssClass="menu"> <Items> <asp:MenuItem Text="home" NavigateUrl="~/Default.aspx" /> <asp:MenuItem Text="Aboutus" NavigateUrl="#"/> <asp:MenuItem Text="Support" NavigateUrl="#" /> </Items> </asp:Menu> I have this menu in master page , When the user logs into the website, based on the user role I want to add items to the menu from the server side. How can I do that. Admin(menu to add --> Organisation, Message, Group) Users(menu to add --> Message, Group) Since I have 6 roles I have different menu item for

How to change UIBarButtonItem's type in UINaviagationBar at runtime?

人盡茶涼 提交于 2019-12-05 04:21:09
I am working on an iPhone's view which composed 3 elements, UITextView, UIToolBar with an UIBarButtonItem. The goal is, I want UIBarButtonItem change its style from 'edit' (UIBarButtonSystemItemEdit) to 'Done' (UIBarButtonSystemItemDone) and update new selector to new method. First of all, I have tried following code but it doesn't work: Could you help me on this idea? There is a builtin bar button with this behaviour, you get it via the editButtonItem property of a UIViewContoller. Tabbing that button will change the view controller it came from into editing mode, and toggle the button into a

Navigation bar disappears when typing in UISearchController text field

微笑、不失礼 提交于 2019-12-05 04:19:54
I'm trying to figure out why my whole navigation bar disappears when I start typing in the UISearchController.searchBar It loads properly and animates properly, but I lose the active NavBar when I start typing. Here's the code to load the searchController from viewDidLoad: UITableViewController *searchResultsController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain]; searchResultsController.tableView.dataSource = self; searchResultsController.tableView.delegate = self; searchResultsController.tableView.backgroundColor = [UIColor redColor]; self.searchController = [

UIBarButtonItem Offset?

放肆的年华 提交于 2019-12-05 04:19:18
问题 I am trying to offset the UIBarButtonItems in my app, I need them slightly offset due to the image I use for my navigation bar so it all lines up correctly. I have managed to do this like so: [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:-3 forBarMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackgroundVerticalPositionAdjustment:-3 forBarMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackButtonBackgroundVerticalPositionAdjustment:-3

Large Navigation Bar Text With Multiple Colors

北慕城南 提交于 2019-12-05 03:39:36
iOS 11 introduces the option for larger text in the Navigation Bar. I would like to have a title that uses multiple colors. For example: It's fairly easy to set the title, and even to change the color of the entire title: [[self navigationItem] setTitle: @"Colors"]; [[[self navigationController] navigationBar] setLargeTitleTextAttributes: @{NSForegroundColorAttributeName: [UIColor colorFromHex: redColor]}]; What I can't figure out is how to change just part of the title. For example, a way to select the range like this – NSRangeMake(0, 1) – so that I could apply a color to it. This must be

UINavigationBar without UINavigationController

点点圈 提交于 2019-12-05 03:00:41
I want to have a UINavigationBar in the top of my app, just like in the phone app for example, but I don't want to use it with a UINavigationController , that is, I want to use it as a "standalone" object. The view controller that will have the UINavigationBar has its view in a .xib file. I tried to drag an instance of UINavigationBar from the Object Library and it works fine, but the status bar of the app is still white while the UINavigationBar is gray. I want the status bar to have the same gray tone, but not the rest of the view. To show you what I mean, I have two pictures. The first is

MPMoviePlayerController can exit fullscreen but topbar is gone

左心房为你撑大大i 提交于 2019-12-05 02:47:07
问题 I am streaming a movie on the iPad using MPMoviePlayerController . When the user rotates the device to landscape, I animate it to fullscreen . If the user then taps ' exit fullscreen ' or 'done', the movie animates back to its small frame (native behavior), BUT-- the top bar (navigation bar) is gone . Also, the visible views have moved upwards, behind and beyond the status bar. Note that I haven't touched the top bar whatsoever. I have not manually hidden it. I have tried regaining the

How to set different navigationbar color for different UIViewcontroller in xib?

五迷三道 提交于 2019-12-05 02:31:14
Iam trying to set different UINavigationBar color for different UIViewController in project.Till now i tried following code in ViewdidAppear methode of each UIViewController class and its not working still the color of navigationbar is not changing. UIImage *navBackgroundImage = [UIImage imageNamed:@"redbar.png"]; [[UINavigationBar appearance] setBackgroundImage:navBackgroundImage forBarMetrics:UIBarMetricsDefault]; Please help me Try [[UINavigationBar appearance] setBarTintColor: [UIColor redColor]]; Or, on iOS 6, [[UINavigationBar appearance] setTintColor:[UIColor redColor]]; If you have a

How to disable navigationBar animation?

拥有回忆 提交于 2019-12-05 02:29:37
问题 I have two UITableViewControllers such that when I click next on the first UITableViewController, the second UITableViewController gets pushed on the navigation stack and animates the transition like normal. I'd like to make it so when I push next, only the views animate, and the navigation bar doesn't (stays the same). I've gotten very close to doing this with the code below: - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; CATransition *navTransition = [CATransition