Sunday, 15 April 2012

user interface - Achieving transparent look in iOS -



user interface - Achieving transparent look in iOS -

take @ next screenshots. know how obtain translucent in user interface. how can started create ui similar?

this new api introduced in ios 8. apple's documentation lives here, , this question contains sample code. note - i've been having difficulty in lastly 2 betas, prepared visual bugs.

for ios 7, there simple (and tolerated) hack lets manipulate uitoolbar accomplish similar effect, although less control. there's open-source project here abstracts bit.

edit - here's sample code if you're using swift:

// alter .extralight .light or .dark alter color of blurred view allow blureffect = uiblureffect(style: .extralight) allow backgroundview = uivisualeffectview(effect: blureffect) backgroundview.frame = self.bounds backgroundview.autoresizingmask = .flexiblewidth | .flexibleheight self.addsubview(backgroundview) allow vibrancyview = uivisualeffectview(effect: uivibrancyeffect(forblureffect: blureffect)) vibrancyview.frame = self.bounds vibrancyview.autoresizingmask = .flexiblewidth | .flexibleheight backgroundview.contentview.addsubview(vibrancyview) // now, add together subviews vibrancyview.contentview // effects bit tricky right color of subviews, here's how it's supposed work: // - uicolor.whitecolor() shows pure, solid, (non-translucent) white // - uicolor.graycolor() shows no alter in brightness of underlying view, blurred , vibrant

ios user-interface transparency

No comments:

Post a Comment