Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
I have a Table View set up for the iPad. In the MainWindow-iPad.xib I have a navigation controller, with the Table View Class as the Root View Controller. On the .xib I have a Navigation Bar, View Controller with class of Table View and NIB of Table View. I then have a navigation item, with two buttons. One button reads Archive and is on the left hand side. The other button contains a UIProgressView. I also have placed a label on the navigation bar for when downloads are present it will show name of download, and progressview will be unhidden and show progress of download. However, on the iPad, the word Archive appears as Ar...ve. I have a feeling it is due to either the label or the Progress Bar being too wide, and not giving any room to the BarButtonItem for Archive, but I can't figure out why. ProgressView is added in xib, Label is added in viewDidLoad code:
Code:
progress.hidden = YES;
    CGRect frame = CGRectMake(600, -14, 170, 44);
    downloadlabel = [[UILabel alloc]initWithFrame:frame];
    downloadlabel.textAlignment =  UITextAlignmentCenter;
    downloadlabel.textColor = [UIColor blackColor];
    downloadlabel.backgroundColor = [UIColor clearColor];
    downloadlabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:(18.0)];
I have tried making frame (600, -14, 70, 44) but the button still shortens the button title. Any ideas?
 
How do you add the label to the navbar? Can you show a screenshot of the top of the screen with the navbar?
 
How do you add the label to the navbar? Can you show a screenshot of the top of the screen with the navbar?
I add the label when a file is being downloaded:
Code:
- (void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {

self.nameit = entry.articleTitle;
    downloadlabel.text = [NSString stringWithFormat:@"%@", nameit];
    [thebar addSubview:downloadlabel];
//some code removed
}
attachment.php


And during download:
attachment.php
 

Attachments

  • IMG_0113.PNG
    IMG_0113.PNG
    13.5 KB · Views: 1,186
  • IMG_0114.PNG
    IMG_0114.PNG
    21 KB · Views: 1,118
Last edited:
UIBarButtonItem has a possibleTitles property. This is a list of titles that might be used. It doesn't resize itself if you set a title at a later time that's not in its list of possibleTitles.

UINavigationBar has a titleView property that is meant to be used to add a view to its center. I think I'd use that rather than addSubView to add a label.
 
UIBarButtonItem has a possibleTitles property. This is a list of titles that might be used. It doesn't resize itself if you set a title at a later time that's not in its list of possibleTitles.

UINavigationBar has a titleView property that is meant to be used to add a view to its center. I think I'd use that rather than addSubView to add a label.

So, are you saying I should or shouldn't use possibleTitles property? Sounds like if I set something NOT in its possibleTitles that it should NOT resize itself, as it is doing now...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.