Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
864 views
in Technique[技术] by (71.8m points)

objective-c - 自动布局-屏幕底部的UIView动画(Autolayout - UIView animation from the bottom of the screen)

I am using autolayout in my application.

(我在应用程序中使用自动布局。)

I have a UIPicker at the bottom of screen.

(屏幕底部有一个UIPicker。)

What I want to do is I want to open UIPicker from the bottom of screen on click of UIButton as shown in image below

(我想做的是我想单击UIButton时从屏幕底部打开UIPicker,如下图所示)

选择器位置

I want to know

(我想知道)

  1. which kind of constraint I have to set initially

    (我最初必须设置哪种约束)

  2. which kind of constraint I have to implement programmatically and how it will be implemented?

    (我必须以编程方式实现哪种约束以及如何实现?)

How to get back to its original position?

(如何回到原来的位置?)

  ask by iPhone translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Initially pin top of pickerView to bottom of SuperView and then when you want it to show you can pin bottom of pickerView to bottom of superView .

(最初针顶pickerViewbottomSuperView ,然后当你想让它显示你可以固定bottompickerView至底部superView 。)

OR

(要么)

You can do higher animation by pinning bottom of pickerView to bottom of superView and set height to 0 and when you want to show set height constant to whatEver height is recquired.

(您可以通过将pickerView的底部固定到superView的底部并将高度设置为0来进行更高的动画处理,并且当您想将设置的高度常数显示为需要什么高度时。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...