Хотелось бы показать всем вам картинку, но у меня есть две кнопки в правом верхнем углу моей навигационной панели и кнопка обновления слева. Заголовок находится посередине, но первые две буквы перезаписываются одной из кнопок справа.
Как мне «подтолкнуть» мой заголовок (или заголовок - любой), чтобы заголовок немного сдвинулся? Я хочу переместить его на 60 пикселей вправо.
Код ниже делает то, что я хочу - НО - по какой-то причине теперь кнопки не работают. Код для кнопок идентичен тому, что я использовал раньше (и что раньше работало), с той лишь разницей, что теперь он хранится в панели инструментов / массиве инструментов.
Есть идеи, почему мои кнопки теперь отключены?
// creating the two center buttons in the navigation bar
// create a toolbar to have two buttons in the right
UIToolbar* tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 0, 44.01)];
// create the array to hold the buttons, which then gets added to the toolbar
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:5];
// create a non-bordered button (ends up looking like a title)
UIBarButtonItem *bi = [[UIBarButtonItem alloc] initWithTitle:@"Photos" style:UIBarButtonItemStylePlain target:self action:NULL];
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:NULL];
[buttons addObject:bi];
[bi release];
// create a spacer
bi = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
[buttons addObject:bi];
[bi release];
// create another button with a camera icon
bi = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:@selector(showPhotoPicker)];
bi.style = UIBarButtonItemStyleBordered;
[buttons addObject:bi];
[bi release];
// create a spacer
bi = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
[buttons addObject:bi];
[bi release];
// create another button with 'your photos'
bi = [[UIBarButtonItem alloc] initWithTitle:@"your photos" style:UIBarButtonItemStyleBordered target:self action:@selector(showUserGallery)];
bi.style = UIBarButtonItemStyleBordered;
[buttons addObject:bi];
[bi release];