Giter VIP home page Giter VIP logo

Comments (14)

 avatar commented on August 18, 2024

I'm having the same problem.

from pkrevealcontroller.

pkluz avatar pkluz commented on August 18, 2024

You're correct, because what happens internally is that your view (or rather the vanilla UITableViewController's view) is added as a subview of my internal rearView. I'll test a few things later, i.e. whether I can correct this but for the time being I'd encourage your to set your own frame accordingly.

Note: Remember(!) to consider both iPad and iPhone screen sizes when doing this if you're developing a universal app. I don't recommend using a magic number like 460 to account for the statusbar but rather calculate it yourself in code.

from pkrevealcontroller.

 avatar commented on August 18, 2024

@andybee
I solved the problem for now by adding:
self.view.frame = CGRectMake(0, 0, 320, 480);
to my viewDidLoad on my table view controller.

from pkrevealcontroller.

andybee avatar andybee commented on August 18, 2024

Thanks @autodidakto, as @pkluz suggests that's not a fantastic solution as screen dimensions could change at any time depending on what Apple's future hardware entails. Certainly Universal apps require different sizes dependent on device.

That said, it demonstrates the problem and solution and gets the job done.

from pkrevealcontroller.

bbshih avatar bbshih commented on August 18, 2024

I had this problem for the last month and kept coming back to it. Finally dived into it deeply and assumed this was the issue. Glad I found this! Thanks everyone.

Here's what I did to solve it without static sizes:

CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
self.view.frame = CGRectMake(0.0, 0.0, appFrame.size.width, appFrame.size.height + statusBarFrame.size.height);

See any problems with this?

from pkrevealcontroller.

andybee avatar andybee commented on August 18, 2024

Shouldn't the height calculation be:

appFrame.size.height - statusBarFrame.size.height

from pkrevealcontroller.

bbshih avatar bbshih commented on August 18, 2024

The appFrame is actually too short because it has taken into account an extra status bar so it needs to be added back in. It ends up being repositioned to 0,0 and then fills the entire size of the screen.

  • Billy Shih
    Via iPhone

On Friday, June 1, 2012 at 11:23 PM, andybee wrote:

Shouldn't the height calculation be:

appFrame.size.height - statusBarFrame.size.height


Reply to this email directly or view it on GitHub:
https://github.com/pkluz/ZUUIRevealController/issues/40#issuecomment-6075283

from pkrevealcontroller.

andybee avatar andybee commented on August 18, 2024

Of course, silly me. I forgot the original issue!

Looks good. Have you forked, amended, and made a pull request?

from pkrevealcontroller.

drewish avatar drewish commented on August 18, 2024

Pull request #50 fixes this.

from pkrevealcontroller.

xingzhisg avatar xingzhisg commented on August 18, 2024

No additional codes in the framework required actually. You simply needs to set wantsFullScreenLayout to YES for your ZUUIRevealController, i.e.

ZUUIRevealController * revealController = [[ZUUIRevealController alloc] init ...];
revealController.wantsFullScreenLayout = YES;
...

from pkrevealcontroller.

drewish avatar drewish commented on August 18, 2024

Xingzhisg, but shouldn't it do that for you? It seems like that should be the default behavior, right?

from pkrevealcontroller.

bbshih avatar bbshih commented on August 18, 2024

It does seem like something that should be built in.

Xingzhisg solution does work, but according to UIViewController documentation, setting a UIViewController's wantsFullScreenLayout to YES should make it fill the status bar area. It doesn't do that in this case because of the double status bar spacing that makes it fill under the status bar with no overlap.

I believe my fix should be implemented still since if someone truly wants wantsFullScreenLayout, it will work correctly and fill the status bar area.

from pkrevealcontroller.

bbshih avatar bbshih commented on August 18, 2024

In iOS6 I'm now seeing the bar being moved up too high! Not sure what change caused this but as a workaround I've changed my code to:

rearViewController.view.frame = CGRectMake(0.0, statusBarFrame.size.height, appFrame.size.width, appFrame.size.height);

If anyone knows what changed, let me know.

from pkrevealcontroller.

wayneljw avatar wayneljw commented on August 18, 2024

Thanks bbshih for the solution. But it has an issue for me.
Say I have a tableview setup for the rearview, and rearViewRevealWidth is set to 260.0
All my table view cells have accessories which are disclosure indicator.
The accessories could be hidden behind the front view if we declare the frame this way.

So I use the following solution:

CGRect rearViewFrame = rearViewController.view.frame;
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
rearViewController.view.frame = CGRectMake(0.0, 0.0, rearViewFrame.size.width, rearViewFrame.size.height - statusBarFrame.size.height);

This solution is evolved from bbshih's 1st solution. But I don't have iOS6 installed, I cannot test if this would work on iOS6.

I will test for iOS 6 the 1st thing when it is released.

from pkrevealcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.