문제

My objective here is to recreate this option view that Facebook messenger and many other apps use when they are displaying options.enter image description here

What is the best way to go about doing this? Is there a built in class that will let me do this? Are there good third party apps that will accomplish this task?

도움이 되었습니까?

해결책

So after doing some digging what you need is an action sheet. Action sheets are pretty straight forward, to set an action sheet up:

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
                                                     delegate:self
                                            cancelButtonTitle:@"Cancel"
                                       destructiveButtonTitle:@"Delete Note"
                                            otherButtonTitles:nil];

To Collect Response

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
    NSLog(@"The %@ button was tapped.", [actionSheet buttonTitleAtIndex:buttonIndex]);
}

More info: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/UIKitUICatalog/UIActionSheet.html#//apple_ref/doc/uid/TP40012857-UIActionSheet

Extra:

Here is an open source modal framework: https://github.com/reednj/TDSemiModal

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top