如何在ios中自定义定义函数
我开发了一个即时意义检查器,就像UIMENU按钮中的一个一样,它工作得很好,但是由于我使用了警报方法来显示意义,警报的外观并不好。有人能告诉我如何在UIMENU按钮中获得define方法的外观吗如何在ios中自定义定义函数,ios,customization,uimenuitem,Ios,Customization,Uimenuitem,我开发了一个即时意义检查器,就像UIMENU按钮中的一个一样,它工作得很好,但是由于我使用了警报方法来显示意义,警报的外观并不好。有人能告诉我如何在UIMENU按钮中获得define方法的外观吗 UIAlertView *av = [[UIAlertView alloc] initWithFrame:CGRectMake(0,0,300,200)];//[[UIAlertView alloc] initWithTitle:newstring message:nil delegate:nil ca
UIAlertView *av = [[UIAlertView alloc] initWithFrame:CGRectMake(0,0,300,200)];//[[UIAlertView alloc] initWithTitle:newstring message:nil delegate:nil cancelButtonTitle:@"ཕྱིར་འཐེན།" otherButtonTitles:nil];
av.title = newstring;
av.layer.backgroundColor=(__bridge CGColorRef)([UIColor colorWithRed:22/255.0f green:113/225.0f blue:9/255.0f alpha:1.0f]);
av.message = nil;
av.delegate = nil ;
[av addButtonWithTitle:@"ཕྱིར་འཐེན།"];
//[av addButtonWithTitle:@"OK"];
UITextView *v = [[UITextView alloc] initWithFrame:CGRectMake(0,0,300,200)]; //av.bounds];
v.text=newstring1;
[v setEditable:NO];
v.font=[UIFont fontWithName:@"Monlam Uni OuChan2" size:19];
[av setValue:v forKey:@"accessoryView"];
v.backgroundColor = [UIColor yellowColor];
[av show];
这是代码,我得到的警报视图是我假设您正在使用点击手势显示菜单。 以下代码显示100x100的UIMenu,标题为“自定义操作”
有关详细版本,请查看。我假设您正在使用点击手势显示菜单。 以下代码显示100x100的UIMenu,标题为“自定义操作”
有关详细版本,请查看。各位可以知道如何解决问题吗?…各位可以知道如何解决问题吗。。。。
- (void)handleTapGesture:(UITapGestureRecognizer *)tapGesture {
NSLog(@"tapGesture:");
// CGRect targetRectangle = self.tapView.frame;
CGRect targetRectangle = CGRectMake(100, 100, 100, 100);
[[UIMenuController sharedMenuController] setTargetRect:targetRectangle
inView:self.view];
UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Custom Action"
action:@selector(customAction:)];
[[UIMenuController sharedMenuController]
setMenuItems:@[menuItem]];
[[UIMenuController sharedMenuController]
setMenuVisible:YES animated:YES];
}