aryaxt / iOS-Slide-Menu

iOS Slide Menu with ability to add both left and right menu, and built in gesture recognizer. Similar to Path and Facebook
Other
1.53k stars 359 forks source link

Screen flickering and corrupted when magnifying glass appears. #153

Open chewedon opened 9 years ago

chewedon commented 9 years ago

Hello,

Nice library.

I got a problem when I use this library, there seems to be a screen rendering bug when I try to change the text cursor/caret position while editing text in a UITextView.

rendering bug

To reproduce the bug:

1) Download the iOS-Slide-Menu project 2) Open FriendsViewController.h and add this code:

#import <UIKit/UIKit.h>
#import "SlideNavigationController.h"

@interface FriendsViewController : UITableViewController <SlideNavigationControllerDelegate>

@property (nonatomic, strong) UITextView *textView;

@end

3) Open FriendsViewController.m and add this code:

 - (void)viewDidLoad
{
[super viewDidLoad];

    self.textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
    self.textView.layer.borderWidth = 1.0;
    self.textView.layer.borderColor = [UIColor redColor].CGColor;

    [self.view addSubview:self.textView];
}

4) Run the app, go to the Friends list screen, you should see a red UITextView input box.

5) Long press on the text view to bring up the magnifying glass and start dragging the magnifying glass around. Everywhere the magnifying glass hovers over, it causes the text to view behind to be clipped/disappear/corrupt/bugged out.

img_1134

img_1135

As you can see in the above screenshot I've taken, the search field completely disappears, the hamburger menu icon and the first few rows of text gets clipped.

I'm digging through the code and hopefully can find a fix but I thought I'd post this bug here in case you guys know what's causing it :D

chewedon commented 9 years ago

I think I found the solution! :D

I'm one happy chap now!

In SlideNavigationController.m when I change line 117:

self.enableShadow = YES;

to

// commenting this out or set to NO to fix screen clipping bug
self.enableShadow = NO; 

And the bug is gone :D

I don't know what side effects this cause, maybe you guys can explain why :P