uibarbuttonitem

MFMailCompose Custom buttons

痞子三分冷 提交于 2019-12-14 03:06:26
问题 UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cancel.png"]]]; button.target = picker.navigationBar.topItem.leftBarButtonItem ; button.action = picker.navigationBar.topItem.leftBarButtonItem.action; picker.navigationBar.topItem.leftBarButtonItem=button; Hi folks, I'm trying to change the style of the buttons of the mail composer. The above code does change the look of the button, however the action seems to be

Change UIBarButton image from gallery

ぃ、小莉子 提交于 2019-12-13 22:19:25
问题 I have UIBarButton and user can change image just chose photo or gallery image with image picker. My problem is bad scale image. If I use AspectFit my UIBarButton look like this: If I use AspectFill my UIBarButton look like this: and if I try first change size image and after set it, image all time scratched: This is my code: func createPhotoBarButton(image: Data) { let barbtn = UIBarButtonItem() var image = UIImage(data:image) if image == nil { image = UIImage(named: "photoIcon") } let

How do I add buttons to a toolbar within an iPad popover?

家住魔仙堡 提交于 2019-12-13 17:16:55
问题 Hoping someone here has conquered this one 'cuz it's driving me crazy. My app includes a popover that is used to enter and edit information. I learned today that it's possible to show a toolbar at the bottom of the popover and that's great -- except that I cannot for the life of me get any buttons to show on said toolbar. Here's where we start: UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController: editorViewer]; //*** This makes the toolbar

How does forwardingTargetForSelector: work?

强颜欢笑 提交于 2019-12-13 15:31:43
问题 I have a UIBarButtonItem . When it receives a message it cannot handle, I want it to forward that message to a particular view controller. I thought I might be able to accomplish this using the bar button item's forwardingTargetForSelector: method, but apparently no such property is found on objects of type UIBarButtonItem . (Point of terminology: Does that mean forwardingTargetForSelector: is a private property? edit: Wait, I think I'm confused... methods with a colon at the end aren't

Change position closer to the right of rightBarButtonItem in UINavigationBar

回眸只為那壹抹淺笑 提交于 2019-12-13 13:19:24
问题 This is my code - (void)createCustomBtnRightBar:(UIImage *)buttonImage { self.navigationItem.rightBarButtonItem = nil; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; if (buttonImage != nil) { [button setImage:buttonImage forState:UIControlStateNormal]; button.frame = CGRectMake(0, 0, 45, 33); button.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -10); } else { [button setTitle:@"Add New Pal" forState:UIControlStateNormal]; button.frame = CGRectMake(0, 0, 110, 24); [button

Insert a image in UINavigationBar instead of text

女生的网名这么多〃 提交于 2019-12-13 08:58:00
问题 i have this piece of code which permits me to insert a title on the UIbar (if i'm not wrong) of the app. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ApplicationDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(goToAlbum) name:@"GetAlbumNotif" object:nil]; self.title = @"Events List"; Can you please give me an orientation to this? Thanks! 回答1: UIImageView

How to set UIBarButtonItem Image on click three tier

南楼画角 提交于 2019-12-13 07:23:52
问题 Hi there my current code is as follows and i would like to know how to implement a button icon change within my current if statement if possible if this is not possible then what code will i need to use instead? Many thanks in advance. viewController.m #import "GroupsViewController.h" #import "CustomCell.h" @interface GroupsViewController () { NSArray *arrayOfImages; NSArray *arrayOfDescriptions; } @end @implementation GroupsViewController { NSString *reuseIdentifier; } - (void)viewDidLoad {

button action not responding iphone

筅森魡賤 提交于 2019-12-13 05:55:06
问题 When I press the nextButton, which is UIBarButton. Then associated action is not performed. UIButton *nextButton1=[UIButton buttonWithType:UIButtonTypeCustom]; [nextButton1 setBackgroundImage:[UIImage imageNamed:@"next.png"] forState:UIControlStateNormal]; [nextButton1 addTarget:self action:@selector(goToItems) forControlEvents:UIControlEventTouchUpOutside]; [nextButton1 sizeToFit]; UIBarButtonItem *nextButton=[[UIBarButtonItem alloc]initWithCustomView:nextButton1]; self.navigationItem

Change color of UIBarButtonSystemItemCancel

大兔子大兔子 提交于 2019-12-13 05:44:43
问题 If I use the UIBarButtonSystemItemCancel, it's color is set to that of the navigation bar. However, in the Photos App, the "Cancel" button is shown with a blue background. How can I also set the UIBarButtonSystemItemCancel to have a blue background please? 回答1: your can use image as button image as UIImage *buttonImage = [UIImage imageNamed:@"image.png"]; //create the button and assign the image UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:buttonImage

UIBarButton won't show in my UINavigationController

巧了我就是萌 提交于 2019-12-13 04:45:36
问题 I want to make a simple view with a navigation bar and a table view. So I created a subclass of UINavigationController and I added a UITableView in it. My is is also the UITableViewDataSource and UITableViewDelegate . Now I want to add UIBarButton in the navigation bar but it doesn't work : UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:[[Translator instance] getTranslation:@"Back"] style:UIBarButtonItemStylePlain target:self.parentViewController action:@selector