问题
I'm using a UIActivityViewController
, but I want to rearrange the order of the available activities. Right now it chooses what order to display them in, and has a bunch of them on a single scrollable line, and then more below a separator. Is it possible to rearrange the order these are displayed in, or to move some of them below the separator line?
回答1:
You can't reorder the activities except for your custom activities. They will appear in the order you supply them. But they always come after the standard activities. You can specify which row the custom activities appear on. Your custom UIActivity
should override the activityCategory
method and return either UIActivityCategoryAction
or UIActivityCategoryShare
.
回答2:
UIActivityViewController doesn't currently provide any mechanism for specifying the order of the available activities, nor does it provide the ability to specify which appear above and below the separator.
There are third party alternatives to UIActivityViewController, such as REActivityViewController, that provide more customization options, but I don't believe it's been updated for iOS 7 yet.
来源:https://stackoverflow.com/questions/19060535/how-to-rearrange-activities-on-a-uiactivityviewcontroller