Difference between revisions of "UIButton"

From iPhone Development Wiki
Jump to: navigation, search
m (Reverted edits by Testatest (talk) to last revision by KennyTM~)
 
Line 1: Line 1:
The NSAutoreleasePool class is a thin wrapper around the '''NSPushAutoreleasePool''' and '''NSPopAutoreleasePool''' functions.
+
'''UIButton''' is a UI element, which is usually a button that the user can tap on to do some actions.
  
<source lang="objc">
+
== Button types ==
#ifdef __cplusplus
+
{{function signature
extern "C" {
+
|signature=+(UIButton*)buttonWithType:(UIButtonType)type;
#endif
+
|firmware=2.0 –
void *NSPushAutoreleasePool(NSUInteger capacity);
+
}}
void NSPopAutoreleasePool(void* token);
+
There 6 documented button types and 9 undocumented button types
#ifdef __cplusplus
+
{| class="wikitable"
}
+
|-
#endif
+
! Type !! Class !! Note
</source>
+
|-
 +
| 0 (UIButtonTypeCustom) || UIButton ||
 +
|-
 +
| 1 (UIButtonTypeRoundedRect) || UIRoundedRectButton ||
 +
|-
 +
| 2 (UIButtonTypeDetailDisclosure) || UIButton || UITableNextButton.png / UITableNextButtonPressed.png
 +
|-
 +
| 3 (UIButtonTypeInfoLight) || UIButton || UIButtonBarInfo.png
 +
|-
 +
| 4 (UIButtonTypeInfoDark) || UIButton || UIButtonBarInfoDark.png
 +
|-
 +
| 5 (UIButtonTypeContactAdd) || UIButton || UIButtonBarContactAdd.png / UIButtonBarContactAddPressed.png
 +
|-
 +
| 100 || [[UINavigationButton]] || style = 0
 +
|-
 +
| 101 || UINavigationButton || style = 1
 +
|-
 +
| 102 || UINavigationButton || style = 2
 +
|-
 +
| 110 || [[UITexturedButton]] ||
 +
|-
 +
| 111 || [[UIGlassButton]] ||
 +
|-
 +
| 112 || UINavigationButton || style = 4
 +
|-
 +
| 113 || UIRoundedRectButton || fillColor = [[UIColor|tableCellGroupedBackgroundColor]]
 +
|-
 +
| 114 || [[UIPopoverButton]] || Normal
 +
|-
 +
| 115 || UIPopoverButton || Delete
 +
|}
  
Example:
+
== References ==
 
+
* Official documentation: {{sdklink|UIKit|UIButton}}
<source lang="objc">
+
{{IPFHeader|UIKit|3=2}}
static void MyMethod()
 
{
 
    void *pool = NSPushAutoreleasePool(0);
 
    [[[NSObject alloc] init] autorelease];
 
    NSPopAutoreleasePool(pool);
 
}
 
</source>
 
 
 
The "capacity" argument of NSPushAutoreleasePool only serves as a hint. It is unused in the current implementation.
 
 
 
{{occlass|library=Foundation.framework}}
 

Latest revision as of 10:56, 2 February 2017

UIButton is a UI element, which is usually a button that the user can tap on to do some actions.

Button types

Signature +(UIButton*)buttonWithType:(UIButtonType)type;
Available in 2.0 –

There 6 documented button types and 9 undocumented button types

Type Class Note
0 (UIButtonTypeCustom) UIButton
1 (UIButtonTypeRoundedRect) UIRoundedRectButton
2 (UIButtonTypeDetailDisclosure) UIButton UITableNextButton.png / UITableNextButtonPressed.png
3 (UIButtonTypeInfoLight) UIButton UIButtonBarInfo.png
4 (UIButtonTypeInfoDark) UIButton UIButtonBarInfoDark.png
5 (UIButtonTypeContactAdd) UIButton UIButtonBarContactAdd.png / UIButtonBarContactAddPressed.png
100 UINavigationButton style = 0
101 UINavigationButton style = 1
102 UINavigationButton style = 2
110 UITexturedButton
111 UIGlassButton
112 UINavigationButton style = 4
113 UIRoundedRectButton fillColor = tableCellGroupedBackgroundColor
114 UIPopoverButton Normal
115 UIPopoverButton Delete

References