39

I have a UIActivityViewController for which I have excluded (using excludedActivityTypes) all the UIActivityCategoryAction activity types.

In iOS 8.2, the UIActivityViewController would only show one line, for the UIActivityCategoryShare activity types.

In iOS 8.3, I get an empty line for UIActivityCategoryAction. See the screenshot below where the second line just has "More".

How can I remove the UIActivityCategoryAction in a UIActivityViewController in iOS 8.3?

enter image description here

Randomblue
  • 112,777
  • 145
  • 353
  • 547
  • I'm having the opposite problem - the first line shows "More..." with nothing in it, and then my action items are in the second row. On 8.2 it would only show one row. – Icydog Apr 17 '15 at 07:11
  • possible duplicate: http://stackoverflow.com/questions/29424570/uiactivityviewcontroller-exclude-all-uiactivitycategoryaction – gbuzogany Apr 28 '15 at 10:34
  • You could maybe show the few lines to create and show the `UIActivityViewController`. That way, whoever wants to help you can get started faster experimenting around with the given problem. – luk2302 May 01 '15 at 07:20
  • 3
    This is even worse if you just want to use AirDrop (or some other custom UIActivityItemSource). In iOS8.2 it would just show the AirDrop row. Now in 8.3 I get *two* useless "More" rows. (I did post a screen shot and some code showing this - but the answer got deleted :-( ) – Rob May 07 '15 at 00:04
  • @Randomblue: I've reposted the code and screenshot from my deleted answer as requested. Hope this helps – Rob May 07 '15 at 23:33
  • It seems that there is no way to remove the bottom row of the uiactivityviewcontroller – eNeF May 11 '15 at 06:34
  • 1
    @Randomblue: I've lodged a Radar with Apple on this issue (20928376). Maybe they will fix it? – Rob May 13 '15 at 00:52
  • @Rob: You were asked to provide a screenshot, not an answer. You could just link to the screenshot in a comment, but try not to use comments for extended discussion. Better to [create a chat room](http://chat.stackoverflow.com/) and share information there. Or ask a new question. – Martijn Pieters May 13 '15 at 14:20

5 Answers5

11

In iOS 8, UIActivityViewController is still an API that only provides custom functions, but not custom UI. You can't change the way it looks. The only part of the visual style you can change is the icon of your custom UIActivity subclasses. (ref)

This is how Apple implements this, and it cannot be changed as of 8.3. If you really want to avoid the extra row and the "More" button, you can implement a UIActivityViewController replacement. Here are a couple that have been recently maintained:


OvershareKit

OvershareKit


URBNShareKit

URBNShareKit


References:

Community
  • 1
  • 1
Drakes
  • 23,254
  • 3
  • 51
  • 94
  • @RandomBlue This was the best answer I could come up with for you. I have iOS apps on the Store now, and I have to live with this. It's just what we have to do for 8.3 for now. People in work circles have no better solutions I'm afraid. – Drakes May 22 '15 at 13:39
1

This is by-design so that users can add back system and third-party actions that they've hidden.

Tim Johnsen
  • 1,471
  • 14
  • 33
1

The More is system default. that is used to reordering the application. and for extension(introduce in IOS 8), More button is used to reorder the app as well add application in dialogue. we don't have any control over it.

Hope this help you.

Jatin Patel - JP
  • 3,725
  • 2
  • 21
  • 43
  • 1
    This is poorly designed. When there are no extensions, and nothing to reorder, then the **More** button should go away. – Randomblue May 13 '15 at 17:09
  • @randomblue, I think in next launched apple developer fixed this issue. – Jatin Patel - JP May 13 '15 at 18:21
  • @Randomblue it's not really poorly designed. It's a functionality your provided with that Apple controls... not something you should even care about the appearance of considering it's a standardized screen. – TheCodingArt May 19 '15 at 15:09
0

I find a away to remove the UIActivityCategoryAction . Like that: demo

As the UIActivityCategoryAction is the second section of a CollectionView , You can find collectionView's dataSource and change the implement of the "numberOfSectionsInCollectionView:" by method swizzling. here is the demo:enter link description here

0

UIActivityCategoryAction is the second section of a UIColletionView , change the number of section equal to 1 ,and the UIActivityCategoryAction will disappear.

Here is the demo