Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize Cancel button of Twitter framework

Tags:

xcode

iphone

ios5

enter image description hereI am using twitter framework .There is cancel and send buttons on the UIView which is present when we call the TWTweetComposeViewController class. I want to change the color of Cancel Button as of send button but currently it shows gray color.I tried to reach the subviews and found that Cancel button is of type UIButtonLabel which is private class . However it is subclass of UILabel and tried to change the color by using condition that it's superclass is UILabel and text is Cancel. When I try to NSLog the subviews it sometimes nslogs it but sometimes does not print the superview of Cancel button (which is a UIButton). I have print the details of that button :

 <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>>")

Is it possible to change the color of the button ? Please guide.

like image 327
Jaspreet Singh Avatar asked Nov 13 '22 21:11

Jaspreet Singh


1 Answers

You may want to consider DETweetComposeViewController, an open-source clone of the official TWTweetComposeView controller, which is also compatible with iOS 4.

It looks exactly like the official controller out of the box, but being open-source you can easily customize it.

like image 83
Gabriele Petronella Avatar answered Nov 15 '22 10:11

Gabriele Petronella