iphone - 自定义Twitter框架的取消按钮

标签 iphone xcode ios5

enter image description here我正在使用 twitter 框架。UIView 上有取消和发送按钮,当我们调用 TWTweetComposeViewController 类时,该按钮就会出现。我想更改发送按钮的取消按钮的颜色,但目前它显示灰色。我尝试访问 subview ,发现取消按钮的类型为 UIButtonLabel ,它是私有(private)类。然而,它是 UILabel 的子类,并尝试使用其父类(super class)为 UILabel 且文本为 Cancel 的条件来更改颜色。 当我尝试 NSLog subview 时,它有时会记录它,但有时不会打印“取消”按钮(这是一个 UIButton)的 super View 。我已经打印了该按钮的详细信息:

 <UIButton: 0x859fe10; frame = (265 7; 52 30); alpha = 0; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x859fea0>>.....(
"<UIImageView: 0x85b8910; frame = (0 0; 52 30); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x85b7c30>>",
"<UIButtonLabel: 0x859ffb0; frame = (6 7; 40 15); text = 'Cancel'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x85a0020>>")

是否可以更改按钮的颜色?请指导。

最佳答案

您可能需要考虑DETweetComposeViewController ,官方 TWTweetComposeView Controller 的开源克隆,也与 iOS 4 兼容。

它看起来与开箱即用的官方 Controller 一模一样,但由于是开源的,您可以轻松自定义它。

关于iphone - 自定义Twitter框架的取消按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12757483/

相关文章:

iphone - objective-c 源 locationManager 在自己的类中

ios - 如何在验证按钮时启用/禁用按钮?

r - 错误 : Could not find build tools necessary to build

ios - CGContextSaveGState : invalid context 0x0 at App Launch

objective-c - ConvertRect 占 UIScrollView 缩放和 contentOffset

ios - AFNetworking (AFHttpClient) 离线模式不适用于 NSURLRequestReturnCacheDataDontLoad 策略

iphone - 获取 iPad 应用程序的启动方向

iphone - UIApplication beginBackgroundTaskWithExpirationHandler 问题

iPhone 开发 - 手动创建 UIButton

ios - xcode 4.2:“为企业分发”按钮在哪里?