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

drawer size not correct on iphone4s #8

Closed
aotian16 opened this issue Jul 8, 2015 · 6 comments
Closed

drawer size not correct on iphone4s #8

aotian16 opened this issue Jul 8, 2015 · 6 comments
Labels

Comments

@aotian16
Copy link

aotian16 commented Jul 8, 2015

when i run KGFloatingDrawer app on my iphone4s,
drawer only show parts of it, about 1/3.

on iphone6 is ok.
simulator iphone4s is also ok.

sorry for my poor english.

@KyleGoddard
Copy link
Owner

hmm, I'll see if I can find an old device and have a look.

@KyleGoddard KyleGoddard added the bug label Jul 8, 2015
@aotian16
Copy link
Author

aotian16 commented Jul 9, 2015

I update my iphone4s os version from 7.1 to 8.4.
and it's ok now.

Maybe it's a bug of os 7.1 version?

thanks to your nice project

@KyleGoddard
Copy link
Owner

that would be why, the deployment target must be 8.0+

@aotian16
Copy link
Author

aotian16 commented Jul 9, 2015

what should i do if i want to run on 7+?
In my country, still lots of 7+

@KyleGoddard
Copy link
Owner

You could look at the project that KGFloatingDrawer was based on https://github.com/JVillella/JVFloatingDrawer. The deployment target for this is iOS 7.

@aotian16
Copy link
Author

Thank you , but i am a newbee on swift, and not familiar with obj-c.
I notice that JVFloatingDrawer have the same issue too.

JVillella/JVFloatingDrawer#9

I try to fix this with code bellow, and looks like work fine

    private func applyTransforms(side: KGDrawerSide, drawerView: UIView, centerView: UIView) {

        let direction = side.rawValue
        let sideWidth = CGRectGetWidth(drawerView.bounds)
        let centerWidth = CGRectGetWidth(centerView.bounds)
        let centerHorizontalOffset = direction * sideWidth
        let scaledCenterViewHorizontalOffset = direction * (sideWidth - (centerWidth - kKGCenterViewDestinationScale * centerWidth) / 2.0)

//        let sideTransform = CGAffineTransformMakeTranslation(centerHorizontalOffset, 0.0)
//        drawerView.transform = sideTransform
//        
//        let centerTranslate = CGAffineTransformMakeTranslation(scaledCenterViewHorizontalOffset, 0.0)
//        let centerScale = CGAffineTransformMakeScale(kKGCenterViewDestinationScale, kKGCenterViewDestinationScale)
//        centerView.transform = CGAffineTransformConcat(centerScale, centerTranslate)

        let sideTranslate3D = CATransform3DMakeTranslation(centerHorizontalOffset, 0.0, 0.0)
        drawerView.layer.transform = sideTranslate3D

        let centerTranslate3D = CATransform3DMakeTranslation(scaledCenterViewHorizontalOffset, 0.0, 0.0)
        let centerScale3D = CATransform3DMakeScale(kKGCenterViewDestinationScale, kKGCenterViewDestinationScale, 1.0)

        centerView.layer.transform = CATransform3DConcat(centerScale3D, centerTranslate3D)
    }

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

2 participants