Domanda

I want to make a pop view as the pic shows below (in the red box): enter image description here

I find the UIPopOverController can make the pop view, but it looks like a table (scroll vertically). It doesn`t look like the right-left section style as the pic shows above. I am wondering if this is another IOS API? Or it is totally custom made?

Show me any clue , thanks!

È stato utile?

Soluzione

The menu you are referring to is controlled by the UIMenuController.

Customise the menu items like:

UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Do Something"
                                                  action:@selector(aSelector:)];
[[UIMenuController sharedMenuController] setMenuItems: @[menuItem]];

You will have to implement canPerformAction:withSender: in a custom view class.

NSHipster has a nice article.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top