Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
UIGlassButton: Difference between revisions - iPhone Development Wiki

UIGlassButton: Difference between revisions

From iPhone Development Wiki
mNo edit summary
(update: dropped in iOS 5.1!)
 
Line 1: Line 1:
[[Image:UIGlassButton.png|right|framed|A set of UIGlassButtons with different tint.]]
[[Image:UIGlassButton.png|right|framed|A set of UIGlassButtons with different tint.]]


[[UIGlassButton]] is a subclass of [[UIButton]] which is a button with glassy look. It was once a public class in the 2.0 SDK beta period, but was dropped for some unknown reason. This class was never removed from UIKit though, just being undocumented.
[[UIGlassButton]] is a subclass of [[UIButton]] which is a button with glassy look. It was once a public class in the 2.0 SDK beta period, but was dropped for some unknown reason. It remained as an undocumented class in UIKit until iOS 5.1.<ref>[http://stackoverflow.com/questions/9785586/problems-uiglassbutton-on-ios5-1 "Problems UIGlassButton on ios5.1"]</ref>


== Using UIGlassButton ==
== Using UIGlassButton ==
Line 16: Line 16:
</source>
</source>


== Reference ==
== References ==
* Header: http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UIGlassButton.h
* Header: http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UIGlassButton.h
<references/>


{{occlass|library=UIKit.framework|navbox=on}}
{{occlass|library=UIKit.framework|navbox=on}}

Latest revision as of 01:23, 9 October 2013

A set of UIGlassButtons with different tint.

UIGlassButton is a subclass of UIButton which is a button with glassy look. It was once a public class in the 2.0 SDK beta period, but was dropped for some unknown reason. It remained as an undocumented class in UIKit until iOS 5.1.[1]

Using UIGlassButton

Since UIGlassButton is a UIButton, it can be used like a normal UIButton. UIGlassButton provides an additional property, tint, which you can use to change the color of the button.

Example code:

UIGlassButton* glassButton1 = [[UIGlassButton alloc] initWithFrame:CGRectMake(20, 20, 200, 40)];
[glassButton1 setTitle:@"Foo" forState:UIControlStateNormal];
glassButton1.tintColor = [UIColor redColor];
[glassButton1 addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];
[myView addSubview:glassButton1];
[glassButton1 release];

References