objective-c - 触摸时按钮不突出显示

标签 objective-c ios uibutton highlighting

我是 IOS 开发的新手。我有一个带有“创建”和“取消”两个按钮的 View ,但它们没有突出显示。它们出现在允许长按复制/粘贴/粘贴的 pdf 之上)。实际上“创建”高光真的很快,但是取消根本不会改变状态。知道是什么原因造成的。

-(IBAction)create:(id)sender{

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Name your object" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save",nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];

}

-(IBAction)cancel:(id)sender{

[self.view removeFromSuperview];
[[NSNotificationCenter defaultCenter] postNotificationName:kExitAnnotationView object:nil ];

}

最佳答案

如果您“创建”操作映射到 TouchDown 上,您将看不到按钮的突出显示状态

关于objective-c - 触摸时按钮不突出显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13901992/

相关文章:

ios - 如果条形图没有值,则无法单击核心图中的条形图条

objective-c - 调用-setNeedsDisplay :YES from within -drawRect?

ios - 如何在 NSString 中获取单词或音节的索引

ios - viewDidLoad 在 applicationDidFinishLaunching 之前调用

swift - 将按钮放在 tableview 单元格上时崩溃,无法识别的选择器

ios - 将方法添加到类别(来自 github)

ios - iOS 8 神秘崩溃

objective-c - IOS UILocalNotification 在我的应用程序被删除后生效......如何处理这些通知?

ios - 为什么 Xcode 中的控制台不能使用点符号打印我的对象的属性?

ios - ScrollView 中 UIButton 的动画