Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 为导航栏创建按钮_Iphone_Uibutton_Uinavigationbar - Fatal编程技术网

Iphone 为导航栏创建按钮

Iphone 为导航栏创建按钮,iphone,uibutton,uinavigationbar,Iphone,Uibutton,Uinavigationbar,我的导航栏上有一个按钮作为右按钮: UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Add" style:UIBarButtonItemStyleBordered target:self action:@selector(addToFavouritesButtonPressed:)]; self.navigationItem.rightBarButtonItem = addButton; [addButt

我的导航栏上有一个按钮作为右按钮:

UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Add" style:UIBarButtonItemStyleBordered target:self action:@selector(addToFavouritesButtonPressed:)];
self.navigationItem.rightBarButtonItem = addButton;
[addButton release];
一切都很好,只是我希望它是一个带有一点加号的星星的图像。我认为创建一个png并设置UIBarButtonItem的image属性很容易。然而,这是两件事。它把光泽度和斜角放在我的图像的左右两侧,但不放在图像本身上,其次,我在文档中找不到推荐的按钮大小

是否有一种简单的方法来创建按钮图像,并让系统对其进行格式化,使其看起来像是导航栏的一部分?如果我尝试在Photoshop中创建光泽度和斜面,它看起来不错,但与左侧系统生成的按钮不太一样

希望这是有意义的,任何指点都会很感激


Dave,在我的png中没有alpha通道,创建了一个面具,一切看起来都很好