Search Results

Search found 78 results on 4 pages for 'uitoolbar'.

Page 1/4 | 1 2 3 4  | Next Page >

  • Can I center a UIToolbar item?

    - by Ben
    I am putting a label on a UIToolbar (per this tip: http://stackoverflow.com/questions/333441/adding-a-uilabel-to-a-uitoolbar). But the toolbar has a button on the left side, and so flexible spaces throw the label off the center, which is where I'd like it to be. Can I somehow center this toolbar item so that it remains centered in the toolbar? (Already tried balancing the button with a dummy fixed space, no dice.) Thanks!

    Read the article

  • Custom UIToolBar from Images

    - by Sophtware
    I need to create a UIToolbar object that uses an image for the background. Most of the buttons are images as well, and rectangular. One button, however, is round and overlaps the toolbar like the Start button on the Windows task bar. See below. I know that I will need to subclass the UIToolbar to paint the image for the toolbar -- I think. If so, does anyone have example code showing how to do this? Furthermore, does anyone have any ideas on how to implement the larger round button? I'm thinking of another custom subclass for this, but not sure if there might be an easier way. I can have the art guys chop the image anyway needed, which I'm sure the round button will need to be chopped some how. Any ideas or sample code?

    Read the article

  • UIToolbar UIBarButtonItem Alignment question

    - by Luther Baker
    I need to create a UIToolbar that has two UIBarButtonItems. The 1st button must be centered and the 2nd item must be right aligned. I understand and use Flexible spacing and it works great when I need to balance buttons across the UIToolbar, but with only two buttons, I can't seem to perfectly center the middle button. I've even initialized the view.toolbarItems array with NSArray *items = [[NSArray alloc] initWithObjects:fixed, flex, center_button, flex, right_button, nil]; and set fixed.width = right_button.width ... but still, the center_button is never perfectly centered.

    Read the article

  • Weird background offset of UIToolbar when in formSheet.

    - by Mike A
    As you can see in the pic, the buttons from the toolbar on the right align perfectly with the segmented control on the left. They are displayed on the navigation bar. For some reason though, the background of the toolbar seems to be offset 1px to the bottom. What is especially weird, is this exact same view controller, in fullScreen or even pageSheet, displays everything properly. Segmented control is being allocated: UISegmentedControl* segmentControl = [[UISegmentedControl alloc] initWithFrame:CGRectMake(0,0,300,30)]; Toolbar is being allocated: UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100,44)]; I've spent hours trying to fix this, it's driving me crazy.

    Read the article

  • UIToolBar and iPhone Interface Orientation Problem

    - by Leo
    I am developing an application in iPhone. One view support orientation in portrait and landscape. I have two separate views for both orientation. This view has a UIToolbar at the top. Problem is when I change view back from landscape to portrait, UIToolbar at the top disappears. I want toolbar to come back in its original position when it is rotated back to portrait. This is what I am doing in my program. - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration { if (interfaceOrientation == UIInterfaceOrientationPortrait) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(0)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(180)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } } I don't know what am I missing here? Any help would be really appreciated.

    Read the article

  • Hiding a UINavigationController's UIToolbar during viewWillDisappear:

    - by Nathan de Vries
    I've got an iPhone application with a UITableView menu. When a row in the table is selected, the appropriate view controller is pushed onto the application's UINavigationController stack. My issue is that the MenuViewController does not need a toolbar, but the UIViewControllers which are pushed onto the stack do. Each UIViewController that gets pushed calls setToolbarHidden:animated: in viewDidAppear:. To hide the toolbar, I call setToolbarHidden:animated: in viewWillDisappear:. Showing the toolbar works, such that when the pushed view appears the toolbar slides up and the view resizes correctly. However, when the back button is pressed the toolbar slides down but the view does not resize. This means that there's a black strip along the bottom of the view as the other view transitions in. I've tried adding the toolbar's height to the height of the view prior to hiding the toolbar, but this causes the view to be animated during the transition so that there's still a black bar. I realise I can manage my own UIToolbar, but I'd like to use UINavigationControllers built in UIToolbar for convenience. This forum post mentions the same issue, but no workaround is mentioned.

    Read the article

  • Customize UIToolBar with Background Image

    - by Taimur Hamza
    hi, I want to add a background image to my UIToolbar instance. This line of code doesnt work. myToolBar.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Layer-1.png"]]; Another solution tht i found out from stackoverflow aint working as well UIImage *myimage = [UIImage imageNamed:@"Layer-1.png"]; myToolBarImage.image = myimage; [self.view addSubview:myToolBarImage]; [self.view sendSubviewToBack:myToolBarImage]; [self.view addSubview:myToolBar]; Kindly help me out. Thanks

    Read the article

  • - Button's positioning on UIToolBar in IB -

    - by gotye
    Hey guys, As a fervent adept of IB, I created a UIToolBar (in IB of course) and added to it a few buttons. So far so good ... but then I tried to move each of them to the right position but IB doesn't let me do it ... Each time I try to scroll them IB moves them back to the former position ! Is there a way to choose their position in IB ? If not, could you give me a piece of code for me to choose their position programatically ? (sigh :D) Thanks, Gotye.

    Read the article

  • How to programmatically replace UIToolBar items built in IB

    - by frankodwyer
    I have a toolbar with various image buttons, created in Interface Builder. I'd like to be able to programmatically replace one of the buttons with an activity indicator when pressed, and then put back the original button but change its color from white to yellow when the activity completes. Is this possible with an IB built toolbar or must I look at building the whole toolbar programmatically and custom views?

    Read the article

  • Can I apply a texture to UIToolbar?

    - by Ben
    I tried doing this: [toolbar setTint:[UIColor colorWithPatternImage:[UIImage imageNamed:@"thingFromMyBundle.png"]]]; but it just ended up black. At first I assumed you weren't allowed to "tint" with a texture, but I've seen apps recently that can do this. Am I missing something? Thanks.

    Read the article

  • How can I create a custom UIToolbar like component in a UITableViewController?

    - by Tony
    I have a UITableViewController. I want a "toolbar-ish" component at the bottom. I started by using a background image and a button. In interface builder, I added them to the bottom of the iPhone screen. The problem I ran into was that the background image and button scrolled with the table. I obviously need this fixed at the bottom. Not finding too much direction online, I decided to customize a UIToolbar to look how I want since the position is fixed by default. In my initWithNibName for my UITableViewController, I have: UIImage *shuffleButtonImage = [UIImage imageNamed:@"shuffle_button.png"]; NSArray* toolbarItems = [NSArray arrayWithObjects: [[UIBarButtonItem alloc] initWithImage:shuffleButtonImage style:UIBarButtonItemStylePlain target:self action:@selector(push:)], nil]; [toolbarItems makeObjectsPerformSelector:@selector(release)]; self.toolbarItems = toolbarItems; The problem I am running into now is that the "shuffleButtonImage" is not showing up properly. The shape of the button shows up fine but it is colored white and therefore does not look like the image. Does anyone know why a "white image" would be showing instead of the actual image? Also does it sound like a good idea to customize a UIToolbar or is there a simple way to ensure a fixed position "toolbar-ish" component. To reiterate - my "toolbar-ish" component only needs to be one button at the button of my UITableView. The single button has a gradient color background that I create with an image.

    Read the article

  • How do you adjust the frame or vertical alignment of a UIBarButtonItem contained by a UIToolbar inst

    - by akaii
    Horizontal positioning of UIBarButtonItems is no problem, I can simply pad the space with fixed/flexible space items. However, I can't seem to adjust the toolbar item vertically. UIToolbar has no alignment property, and UIBarButtonItem has no way of setting its frame. I need to do this because we're using a mix of custom icons created using initWithImage, and standard icons created with initWithBarButtonSystemItem. The custom icons aren't being centered properly (they're offset upwards, relative to the system icons, which are centered properly), so the toolbar looks awkward.

    Read the article

  • What is the best way to move a UIToolbar?

    - by Ferdinand Rios
    Here is an interesting problem. On the iPhone, I have a view set up that has a toolbar on the bottom of the screen. I am currently trying to make this a universal app so that it runs on iPad as well. I would like the toolbar to be at the top of the iPad screen, so in the viewDidLoad method of the specific viewController I have the following code. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { //move the toolbar to the top of the page and move the webview down by the height of the toolbar CGRect toolBarFrame = self.aToolBar.frame; CGRect webFrame = self.aWebView.frame; webFrame.origin.y = toolBarFrame.size.height; [self.aWebView setFrame:webFrame]; toolBarFrame.origin.y = 0; [self.aToolBar setFrame:toolBarFrame]; [Utils errorString:[NSString stringWithFormat:@"origen: x=%f y=%f", self.aToolBar.frame.origin.x, self.aToolBar.frame.origin.y]]; [Utils errorString:[NSString stringWithFormat:@"origen: x=%f y=%f", self.aWebView.frame.origin.x, self.aWebView.frame.origin.y]]; } The problem I am having is that the webView moves down fine, but the toolbar only moves up to about what seems to be the height of a iPhone screen. The call to errorString tells me that the webView's origin is at 0,44 (where it should be) and that the toolbar's origin is at 0,0, but it is actually somewhere in the middle of the screen! Anybody have a clue what is going on here?

    Read the article

  • How can I use a single UIToolbar with multiple different UIViewControllers?

    - by Aeonaut
    I have a simple app with two basic screens, a UIMapView and a UITableView. I'd like to have a toolbar at the bottom with a couple of buttons and a UISegmentedControl with two segments: "Map" and "Table". (The layout is similar to the Google Maps app that ships with the iPhone.) How can I keep the same toolbar while presenting either the UIMapView (with a UIMapViewController) or the UITableView (with a UITableViewController) when the user switches back and forth on the segmented control? Of course, I can just create an identical toolbar for each of the two different views and display them separately, but is there a better way?

    Read the article

  • Hiding UIToolBar for child views of UITableViewController

    - by Robin Jamieson
    My main controller is a subclass of UITableViewController with a UIToolBar at the bottom and when a row is selected, I'd like to display another view without the toolbar. How can I hide the UIToolBar in the child view? Right now, it's present throughout all child views unless they're created as modal. Toolbar is created in RootController: self.toolbar = [[UIToolbar alloc] init]; // add tool bar items here [self.navigationController.view addSubview:toolbar]; RootController displays its child views as such: UIViewController *controller = [[UIViewController alloc] init...] [self.navigationController pushViewController:controller animated:YES]; RootController is instantiated as such in the app delegate's applicationDidFinishLaunching: RootController *rootcontroller = [[RootController alloc] initWithStyle:UITableViewStyleGrouped]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:rootcontroller]; [rootcontroller release]; [window addSubview:[self.navigationController view]]; If I add the toolbar to [self.view] within RootController instead of navigationController's view, the toolbar disappears alltogether..

    Read the article

  • problem with adding tool bar to UITableView

    - by chnet
    I'm writing a Navigation-Based iPhone app, and I'd like to have a UIToolBar docked at the bottom of my screen, with a UITableView scrolling between the tool bar and the navigation bar. I used [[self navigationController] setToolbarHidden:NO] and - (void)setToolbarItems:(NSArray *)toolbarItems animated:(BOOL)animated to set the UIToolBar. UIToolBar correctly shows in current view. If I drill down into a detail view using the button on navigation bar, i cannot return back to previous view. Before I add the tool bar, it can return back. I am wondering is there anything else should be noted when use UIToolbar?

    Read the article

  • Custom uitoolbar gets partly hidden

    - by Jakub
    I'd like to add a custom UIToolbar to my UIViewController. In Interface Builder I add the uitoolbar at the top of my view, and it looks just fine. However, when I run the app in the Simulator it gets hidden by the default iphone bar (this one with the clock, battery status, etc.). Here you can see how it looks like: Any ideas?

    Read the article

  • How do I force one method to be executed before another method?

    - by RexOnRoids
    I've got 2 methods. One method starts playing an audio file (.mp3), the other method updates a UIToolBar to show a button (PLAY or PAUSE). These two methods are called in the following order: //Adds some UIBarButtonItems to a UIToolBar [self togglePlayer]; //Uses AVAudioPlayer [audioPlayer play]; I call the methods in the above order so that the (pause) button will be shown at the time the song starts playing. But, the problem is that the song starts playing first, and the UIToolBar remains unchanged for quite a while (from 2 to 5 secs) until the button is added and shown. What I want is for the button to be shown at the same time the song starts playing (i.e. NO DELAY). Is there any way to do this?

    Read the article

  • How to set the title of UIToolBar?

    - by Kelvin
    How can I set the title of UIToolBar such that it looks the same as the title in UINavigationBar? I tried to use a button with plain style, it looks ok, but it will be highlighted when I click on it... Is there any better way to set the title in the detail view of split view?

    Read the article

  • UIButton doesn't appear on UIToolbar

    - by Sheehan Alam
    I have a UIToolbar where I have dragged a UIButton. When I set the button properties to Custom, and assign an image (or background image) the graphics don't appear. However, when I give it a custom text, the text will appear. Why is it that the images don't appear?

    Read the article

  • UILabel over a UIToolBar

    - by paul simmons
    Hi, I have put a UILabel over a UIToolbar. It works fine (changing colors & text) but when I click something on the toolbar, from that moment on, UILabel's text color is like 'faded'. I have tried bringing UILabel to front but that did not work. Any suggestions?.

    Read the article

  • slide-in uitoolbar

    - by alexeyndru
    I would like to add a uitoolbar able to slide -in from the top of the screen when some button is pushed. With all the research done this week-end I am still stuck. Please help.

    Read the article

1 2 3 4  | Next Page >