7

In two places in our app the text that the user types in only shows first line of text. Both occurances are in external frameworks, first in UIActivityView, the other in Freshdesk MobiHelp.

First, with UIActivityView, when using Twitter:

The problem is that if the text goes beyond one row in the modal, the text goes transparent:

screenshot

NSString *textToShare = [NSString stringWithFormat:NSLocalizedString(@"CHALLENGE-TWITTER-  DEFAULT-TEXT", nil), [UserManager currentUser].displayName];
NSString *urlToShare = [NSURL URLWithString:@"http://example.com"];
NSArray *activityItems = @[textToShare, urlToShare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];

Second, in Freshdesk submit a ticket: screenshot

I should also add that the Facebook modal from UIActivityView works just fine: screenshot

Would really appreciate any tips here, as I'm lost.

Community
  • 1
  • 1
Hans N. Hjort
  • 851
  • 7
  • 19
  • What happens if you edit the text to delete the second line and then add it back in? I'm assuming all the text is the default text. Also, can you show some code you are using to load the default text. – Fogmeister Feb 12 '13 at 09:17
  • It doesn't matter if I add default text (for Twitter) or not. The same text is used for Facebook sharing, and that works just fine. I'll add the code. My, very uneducated, guess it that there is something in our app that messes with these views, but I can't find it. – Hans N. Hjort Feb 12 '13 at 09:20
  • Are you doing anything funky with `UIWindow`s? – WDUK Feb 19 '13 at 12:10
  • @WDUK - not that I can think of. Anything in particular I should look for? – Hans N. Hjort Feb 19 '13 at 12:22
  • Any places where you are creating new instances of UIWindow, and switching them around using `makeKeyAndVisible`. I've had issues with UIMenuController when doing this, but I've never used UIActivityViewController, so this is just a guess. Check if Freshdesk is doing this also. – WDUK Feb 19 '13 at 12:24
  • @WDUK - I can only find one occurrence of `makeKeyAndVisible`, and that's not it. I don't know what the frameworks are doing behind the scenes though.. can I see that somehow? – Hans N. Hjort Feb 19 '13 at 13:43
  • Ah, if the frameworks are compiled libraries, you won't be able to. The Window thing probably isn't it then, I'm not sure what it could be. I'll investigate when I can find some time, this problem is quite intriguing! – WDUK Feb 19 '13 at 14:12
  • Are you sure your label (i guess u used a UILabel) has a pretty long text? – Meera Feb 20 '13 at 13:13
  • I dont think its a problem with your UIWindow. Just add a background color to your label and check whether its visible fully – Meera Feb 20 '13 at 13:16
  • @MeeraJPai - i don't manage either of these labels, since they're in respective framework. – Hans N. Hjort Feb 20 '13 at 14:18
  • is the view handled by you? can you please cross check whether any view is above your label?? – Meera Feb 20 '13 at 14:57
  • With the TweetController are you using the stock instance and not hacking the view hierachy in any way? – Warren Burton Feb 20 '13 at 15:31
  • In the case of Twitter, see the last screenshot of the Facebook modal, it opens from the exact same place, in the same location. I'm opening the UIActivity from a table view that's underneath. The code to open it is above. – Hans N. Hjort Feb 20 '13 at 20:51
  • have you checked what happens when you use a long string literal instead of NSLocalizedString? maybe there is some weird formatting that is messing something up in your localization. just a thought – G. Shearer Feb 26 '13 at 06:42

1 Answers1

1

I think in the second sreenshot that you have attached here, there is a white screen over a red area which probably might be your label or the text area and I guess its blocking your text area. If the view was added by you, you can get the particular text area to front so that its not blocked and you can see your text. Hope this helps

enter image description here Can you see a white box inside the one I highlighted? There is some view over your textarea. How are you adding your textarea? As a subview?? Can you just get log the main views subviews?? Like

NSLog (@"%@",[self.view subviews]);

And now check the view hierarchy.

Meera
  • 1,031
  • 6
  • 25
  • The view hierarchy is important especially when an opaque view hides other view. So check the view hierarchy too. May be that would be the problem. – Meera Feb 20 '13 at 15:06
  • This View is opened by a simple call to the Freshdesk framework: `[[FDSupport sharedInstance] presentSupport:self];`. I'm not managing any of the views or labels that are shown after the call. – Hans N. Hjort Feb 20 '13 at 20:56
  • I am not familiar with the framework you used. So I cant specifically tell whats happening – Meera Feb 21 '13 at 05:38
  • I'm grateful for your time here. I did add the NSLog part, there's alot of views there so it won't fit here. Just to make sure, could a view that's added before ("below"), block what's showing in the screenshots? – Hans N. Hjort Feb 25 '13 at 14:08
  • From what it seems, you either have a another view blocking your text view, or the parent view of the text view's frame is limited. I would suggest adding transparent background to see. You could do [view setBackgroundColor:[UIColor colorWithRed:1.0 Green:0 Blue:0 Alpha:0.2f]]; – Ege Akpinar Feb 25 '13 at 23:54
  • HansNilsson: Views which are present above your text area in hierarchy can block other view beneath. Can you get me the NSLog? – Meera Feb 26 '13 at 05:06
  • There are a lot of views in the log. Try setting bgcolors. As i am not familiar with the framework I cant tell you why and what's actually blocking the view! – Meera Feb 26 '13 at 08:48
  • As the views in the Framework are out of reach, I don't see how I can try different background colors.. I want to point out again that this issue is happening in two different places, with two different frameworks. – Hans N. Hjort Feb 26 '13 at 09:11