Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

background color not changing #62

Open
cs14rendra opened this issue Apr 13, 2016 · 4 comments
Open

background color not changing #62

cs14rendra opened this issue Apr 13, 2016 · 4 comments

Comments

@cs14rendra
Copy link

I am running swift demo app , background color showing black . In another project , i am calling it in a observer and When app coming from background then at that time only background color is showing change .
NSNotificationCenter.defaultCenter().addObserverForName(UIApplicationDidEnterBackgroundNotification, object: nil, queue: NSOperationQueue.mainQueue()) {_ in

        if (dataViewController().getpass() == "")
        {  
            self.setPin() // here I am calling set pin screen 

        }else{

            self.lockApp()   // here i am calling to unlock screen 


        }

In one Line - In observer it is working but as a normal code it is not working

@siavashalipour
Copy link

@cs14rendra I have recently created a new Swifty library for iOS pin view. Please have a look. https://github.com/siavashalipour/SAPinViewController

@abury
Copy link
Owner

abury commented Aug 25, 2016

@cs14rendra Sorry but I'm not entirely sure what you mean. The example project describes how to set the background color of the view:

ABPadLockScreenView.appearance().backgroundColor = UIColor(hue:0.61, saturation:0.55, brightness:0.64, alpha:1)

If you can provide an example of the issues you're having I'll try and provide some guidance.

@sarah-jameson
Copy link

I'm having exactly the same issue. Doesn't matter what figures i add it still stays black.

`ABPadLockScreenView.appearance().backgroundColor = UIColor(hue:215, saturation:46.6, brightness:56.7, alpha:1)
screen

Oddly enough my laptop shows the screen being blue and not black both with original settings on the swift demo app.

@abury
Copy link
Owner

abury commented Aug 25, 2016

Thanks for letting me know @sarah-jameson.
Ok, it looks like the UIApperance setter for the background color has broken somehow. I'll add a test and fix for this in the next release.

In the mean time, you can set the background color for the view directly without using UIApperance:

let lockScreen = ABPadLockScreenViewController(delegate: self, complexPin: false)
 lockScreen.view.backgroundColor = UIColor.redColor()

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

No branches or pull requests

4 participants