What are the alternatives for these iPhone controls

What are the alternatives for these controls on the iPhone

  • Radio button
  • Check box
  • Down
  • x raise in Power y in UILabel
  • Hyperlink

Suggestions and answers will be appreciated, thanks.

+7
source share
2 answers

Almost all of these controls can be displayed using UIWebView - if this is not an option, look at the UIWebView implementations and it should give you some idea.

However, if you want inline controls, these are probably the best options:

x by virtue of y in UILabel is easy. Just replace your indices with unicode supercode characters ... I use the following method to turn an integer into a string with superscript characters.

+(NSString *)convertIntToSuperscript:(int)i { NSArray *array = [[NSArray alloc] initWithObjects:@"โฐ", @"ยน", @"ยฒ", @"ยณ", @"โด", @"โต", @"โถ", @"โท", @"โธ", @"โน", nil]; if (i >= 0 && i <= 9) { NSString *myString = [NSString stringWithFormat:@"%@", [array objectAtIndex:i]]; [array release]; return myString; } else { NSString *base = [NSString stringWithFormat:@"%i", i]; NSMutableString *newString = [[NSMutableString alloc] init]; for (int b = 0; b<[base length]; b++) { int temp = [[base substringWithRange:NSMakeRange(b, 1)] intValue]; [newString appendString:[array objectAtIndex:temp]]; } [array release]; NSString *returnString = [NSString stringWithString:newString]; [newString release]; return returnString; } } 

For a hyperlink, use a UITextView with Property Inspector -> Detection -> Links , and Editable behavior is disabled. Of course, it is also available in UIWebView.

+4
source
  • Radio Button: UISegmentedControl
  • UISwitch : UISwitch
  • Drop-down menu: UIPickerView
  • x raise in Power y in UILabel: there is no such thing, you need to draw it yourself.
  • Hyperlink: use UILabel and attach a gesture recognizer for taps to it (or a custom type button)
+7
source

All Articles