Comments (14)
I'm having the same problem.
from pkrevealcontroller.
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.
@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.
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.
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.
Shouldn't the height calculation be:
appFrame.size.height - statusBarFrame.size.height
from pkrevealcontroller.
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.
Of course, silly me. I forgot the original issue!
Looks good. Have you forked, amended, and made a pull request?
from pkrevealcontroller.
Pull request #50 fixes this.
from pkrevealcontroller.
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.
Xingzhisg, but shouldn't it do that for you? It seems like that should be the default behavior, right?
from pkrevealcontroller.
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.
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.
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)
- Limit the pan gesture in the main view
- PKRevealController doesn't play well with unwind segues
- UIScreenEdgePanGestureRecognizer instead of UIPanGestureRecognizer
- LeftView and CenterView Controller both vertical scrollable
- Show left or right UIViewController programmatically. HOT 1
- revealController:willChangeToState firing too late
- It will flash in the first time HOT 1
- leftBarButtonItem
- How to do ajustment of leftview to statusbar in IOS8?
- Disable pan gesture on front VC when showing VCs from side HOT 1
- Difference to UISplitViewController HOT 1
- Panning doesn't work HOT 1
- Create new tag v2.0.7 for CocoaPod
- 2:Issues as need quick assistance
- Add tabbar
- Crashes When Attempting to Present Side View Multiple Times
- setFrontViewController deprecated, no replacement HOT 1
- PKReveal dead? HOT 3
- `prefersStatusBarHidden` is not called in the FrontViewController
- ViewController lost reference when push notification was being clicked and when the app was in background too
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkrevealcontroller.