iphone - 如何检查 UILabel 是否已启用?

标签 iphone ios cocoa-touch uilabel

<分区>

UILabel 可以设置启用:效果很好。但是,如果启用了标签,我以后如何才能知道呢?

Apple 文档说有一个 getter (isEnabled),但它没有被识别为有效的访问器...

有什么想法吗?

最佳答案

检查这个。

UILabel *lbl = [[UILabel alloc] init];
lbl.enabled = YES;
//     lbl.enabled = NO;
if (lbl.isEnabled)
{
    NSLog(@"Enabled");
}
else
{
    NSLog(@"Not Enabled");
}

关于iphone - 如何检查 UILabel 是否已启用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14516539/

上一篇:ios - 如何检查边界框是否包含我的观点

下一篇:iphone - 如何在 IOS 6 中获取此背景条?

相关文章:

iphone - 已弃用 UILineBreakModeCharacterWrap 警告

ios - 当我在 TableView 单元格的 uiimageview 上添加长按手势时。Uiimageview 未显示正确的图像

ios - 在 TableViewCell 中居中 UIView

ios - 如果我使用多个dispatch_async会发生什么

iphone - 如何隐藏/显示 UIimageview?

ios - hockeyapp 不理解崩溃日志

ios - 如何在将 UIView 制作成图像之前正确布局它

iphone - ImageView 以编程方式发送到后台

iphone - iOS - 如何获取 TableView 中最后一项的 IndexPath?

objective-c - Objective-C 中的货币转换