1
私はiPhoneで新しいです...私は4つのボタンでツールバーを作成しました...コードは以下の通りです ...各ボタンの背景イメージを追加したいと思います。誰もがこれを作成するために私を助けて...ツールバーボタンの背景イメージを作成する
TransparentToolbar* toolbar = [[TransparentToolbar alloc] initWithFrame:CGRectMake(0, 0, 256, 50)];
[toolbar setBarStyle: UIBarStyleBlackTranslucent];//UIBarStyleBlackTranslucent
toolbar.translucent = YES;
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:4];
UIBarButtonItem *Messages = [[UIBarButtonItem alloc] initWithTitle:@"About Me" style:UIBarButtonItemStyleBordered target:self action:@selector(currentuserdetails:)];
[buttons addObject:Messages];
[Messages release];
UIBarButtonItem *sendMessageBtn = [[UIBarButtonItem alloc] initWithTitle:@"Send Message" style:UIBarButtonItemStyleBordered target:self action:@selector(sendMessage)];
[buttons addObject:sendMessageBtn];
[sendMessageBtn release];
UIBarButtonItem *blockBtn = [[UIBarButtonItem alloc] initWithTitle:@"Block" style:UIBarButtonItemStyleBordered target:self action:@selector(blockcurrentuser:)];
[buttons addObject:blockBtn];
[blockBtn release];
[toolbar setItems:buttons animated:NO];
// place the toolbar into the navigation bar
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithCustomView:toolbar];
[toolbar release];
TransparentToolbar* toolbar = [[TransparentToolbar alloc] initWithFrame:CGRectMake(0, 0, 256, 50)];
[toolbar setBarStyle: UIBarStyleBlackTranslucent];//UIBarStyleBlackTranslucent
toolbar.translucent = YES;
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:4];
UIBarButtonItem *Messages = [[UIBarButtonItem alloc] initWithTitle:@"About Me" style:UIBarButtonItemStyleBordered target:self action:@selector(currentuserdetails:)];
[buttons addObject:Messages];
[Messages release];
UIBarButtonItem *sendMessageBtn = [[UIBarButtonItem alloc] initWithTitle:@"Send Message" style:UIBarButtonItemStyleBordered target:self action:@selector(sendMessage)];
[buttons addObject:sendMessageBtn];
[sendMessageBtn release];
UIBarButtonItem *blockBtn = [[UIBarButtonItem alloc] initWithTitle:@"Block" style:UIBarButtonItemStyleBordered target:self action:@selector(blockcurrentuser:)];
[buttons addObject:blockBtn];
[blockBtn release];
[toolbar setItems:buttons animated:NO];
// place the toolbar into the navigation bar
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithCustomView:toolbar];
[toolbar release];
ごとに、次のように行うと、この –
感謝のようにそれらをカスタマイズする...私はundestood – sai