简体   繁体   中英

iOS: Distance of 0.5 px between 2 views

I want to clone this control but i don't know how to make a 0.5 pixels distance between two views. Any advices?

Another problem is I can't figure out how to do that blur effect on everything that is below current view. I tried to use alpha but it doesn't look the same.

Thanks!

I want to clone this control but i don't know how to make a 0.5 pixels distance between two views. Any advices?

In Storyboard when you hold an widget (For eg: UITextField) and press alt at the same time, it will show you its alignments with the other widgets. From there you can see whether its having specific pixel distance or not.

Another problem is I can't figure out how to do that blur effect on everything that is below current view. I tried to use alpha but it doesn't look the same.

  • Create a popup view (inherited by UIView )
  • Set background color as [UIColor clearColor]
  • Add an imageView in background to fill entire view
  • Set whiteColor as a background color for this imageView
  • Set alpha property as per your requirement (for eg: imageView.alpha = 0.5f ; )

Hope this is what you're looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM