Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Iphone 4 the ActionSheetStringPicker doesn't work Well #5

Closed
89moku opened this issue Jun 5, 2014 · 21 comments
Closed

On Iphone 4 the ActionSheetStringPicker doesn't work Well #5

89moku opened this issue Jun 5, 2014 · 21 comments
Labels

Comments

@89moku
Copy link

89moku commented Jun 5, 2014

Hi Everyone,
when I'm using this picker on iphone 4 (and only on real device) I've this bug. If I try the same code on the Iphone 3,5 inch simulator it works well...
What it can be?
Thank you so much, best regards!
screenshot 2014 06 05 22 48 35

@skywinder
Copy link
Owner

Hello! Only on device? in simulator it works fine?
Very strange bug. Probably even not project's, but Apple.
Can you provide a little bit more details?

@89moku
Copy link
Author

89moku commented Jun 5, 2014

Hi Petr,
yes only on device… It’s really strange, and on first release of iOS 7 I didn’t had this bug. I think that I got it from iOS 7.1
I’ve a view controller with a MKMapView and the yellow UIButton, with an action when it’s tapped:

  • (IBAction)categoryFilter:(UIControl *)sender {
    NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
    if([language isEqualToString:@"it"]){
    [ActionSheetStringPicker showPickerWithTitle:@"Filtra Categoria" rows:self.categories initialSelection:0 target:self successAction:@selector(filterMap:) cancelAction:nil origin:sender];
    }
    else{
    [ActionSheetStringPicker showPickerWithTitle:@"Filter Category" rows:self.categories initialSelection:0 target:self successAction:@selector(filterMap:) cancelAction:nil origin:sender];
    }
    }

If you need something more, tell me!
Thank you for your quick reply.

Mauro

@skywinder
Copy link
Owner

Just for sure: try to set origin to self.view

- (IBAction)categoryFilter:(UIControl *)sender {
    NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
    if([language isEqualToString:@"it"]){
        [ActionSheetStringPicker showPickerWithTitle:@"Filtra Categoria" 
            rows:self.categories 
            initialSelection:0 
            target:self 
            successAction:@selector(filterMap:) 
            cancelAction:nil 
            origin:self.view];
    }
    else{
        [ActionSheetStringPicker showPickerWithTitle:@"Filter Category" 
            rows:self.categories 
            initialSelection:0 
            target:self 
            successAction:@selector(filterMap:) 
            cancelAction:nil 
            origin:self.view];
    }
}

@89moku
Copy link
Author

89moku commented Jun 5, 2014

Already tryed but no results.

@89moku 89moku changed the title On Iphone 4 the ActionSheetStringPicker doesn't work Welle On Iphone 4 the ActionSheetStringPicker doesn't work Well Jun 6, 2014
@skywinder skywinder added the bug label Jun 6, 2014
@skywinder
Copy link
Owner

Is this problem still actual?
Just for test:
Can you try to set your MKMapView to hidden before show the picker?
like:
mkview.hidden = YES;

@89moku
Copy link
Author

89moku commented Jun 23, 2014

Hi Petr,
I've tried to hide the mkview but there's no good news :(
mkview_hidden

Thank you for your kindly help.

@skywinder
Copy link
Owner

Very strange.
Especially - how your buttons (Filtra Categoria and GPS location) can stay in front of picker. Did you add these buttons programmatically? How?

@89moku
Copy link
Author

89moku commented Jun 23, 2014

I add them in storyboard, they're fixed, nothing is added programmatically

@skywinder
Copy link
Owner

So, what about example of the project? Did you try to run it on your device? is it works correctly?

Ok.. Let's try a dirty hack to figure out, where is the problem.
Let's try to add red background exactly the same size like our actionSheet.
And after dismissing you should see the red frame exactly the same size like actionSheet view.

Add these 3 lines before calling ActionSheet:

- (IBAction)categoryFilter:(UIControl *)sender {

    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 223.25, 320, 433)];
    [view setBackgroundColor:[UIColor redColor]];
    [self.view addSubview:view];

    NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
    if([language isEqualToString:@"it"]){
        [ActionSheetStringPicker showPickerWithTitle:@"Filtra Categoria" 
            rows:self.categories 
            initialSelection:0 
            target:self 
            successAction:@selector(filterMap:) 
            cancelAction:nil 
            origin:self.view];
    }
    else{
        [ActionSheetStringPicker showPickerWithTitle:@"Filter Category" 
            rows:self.categories 
            initialSelection:0 
            target:self 
            successAction:@selector(filterMap:) 
            cancelAction:nil 
            origin:self.view];
    }
}

It should cover all of your views and you should see something like this:
screen shot 2014-06-24 at 00 45 39

@89moku
Copy link
Author

89moku commented Jun 23, 2014

This is what I see...
red

@skywinder
Copy link
Owner

well, go ahead.

Please, set the breakpoint on the line:
_actionSheet.bounds = CGRectMake(0, 0, self.viewSize.width, sheetHeight);

Here is most strange part of legacy code.
Tell me please the value of this parameters here:
self.viewSize.height
sheetHeight
aView.frame.size.height

@89moku
Copy link
Author

89moku commented Jun 24, 2014

self.viewSize.height = 480
sheetHeight = 433
aView.frame.size.height = not available... I see that aView._viewDelegate is nil, is it correct?

@Frozenleaf
Copy link

Interesting thing is, I am observing the same problem with iPhone 4.
It doesn't happen on iPhone 4s, which has the same screen size.

If you adjust the brightness of the area below the "Filtra Categoria" you will need a vertically compress version of the scroll wheel.

@skywinder
Copy link
Owner

@89moku Yes, it's correct. I have no idea why this could happen.
The last thing, that I can recommend to try - is try to push new ViewController and try to represent it there.

@Frozenleaf Very strange bug. So, what about example project? Is it works on iPhone 4?

@garbatix
Copy link

I have the same problem on real device iPhone 4. And it only happen on real device (iOS 7.1), on simulator is ok.

zdjecie

@JaseElder
Copy link

I'm getting the same thing on iPhone 4, 7.1.1
Same with the example project.

The values I get for the above are

self.viewSize.height = 480
sheetHeight = 433
aView.frame.size.height = 260

On iPad 4, 7.1.1, running as an iPhone app, the problem goes away.

@JaseElder
Copy link

I think I've sorted it and added a Pull Request.
I hope so anyway, I'm not really sure about how to use GitHub

@skywinder
Copy link
Owner

@JaseElder thanks! 👍 You're do it right!
@garbatix, @89moku #6 - should fix this problem.
Let me know about results!

@skywinder
Copy link
Owner

try to update pod:
pod 'ActionSheetPicker-3.0', '~> 1.0.8'

@JaseElder
Copy link

pod's all good for me.
Cheers!

@garbatix
Copy link

Works great now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants