What are alternatives for these controls in iPhone
Suggestion and answers will be appreciated, thanks.
To open Control Center, swipe down from the top-right corner of your screen. To close Control Center, swipe up from the bottom of the screen or tap the screen.
Control Center on iPhone gives you instant access to useful controls—including airplane mode, Do Not Disturb, a flashlight, volume, screen brightness—and apps.
UISegmentedControl
UISwitch
UIPickerView
UILabel
and attach a gesture recognizer for taps to
it (or a custom type button)Almost all of these controls can be displayed using a UIWebView - if that's not an option, have a look at the UIWebView implementations and it should give you some kind of idea.
However, if you want native controls, these are probably the best options:
x to the power of y in a UILabel is easy. Just replace your indices with unicode superscript 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
enabled and Editable
behavior disabled. Of course this is also available in a UIWebView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With