简体   繁体   中英

iOS Autolayout - put a view at the bottom with half of it's frame outside the screen

I want to put a view at the bottom of the screen, with half of it's content outside the screen. It means that the center of the the view will be on the bottom of the screen.

Is it possible to be done using AutoLayout? Do I need to do this from code or I can do it from Interface Builder?

Yes it can be done using auto layout. You just need to set the constraints correctly, and If you want to move the view up or down at runtime, you can make IBOutlet of that constraints and can change them at runtime.

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