简体   繁体   English

在iPhone中设置子视图的Y轴值

[英]setting Y-Axis value of subview in iPhone

[selectorView setFrame:CGRectOffset([selectorView frame], 0, -selectorView.frame.size.height)]

In the above code I want to change the value of Y-axis for my subview, as it gets visible from the top of screen and hides my header and search bar. 在上面的代码中,我想更改子视图的Y轴值,因为它从屏幕顶部可见,并隐藏了标题和搜索栏。 I want to set it just beneath to search bar. 我想将其设置在搜索栏的下方。

How can I do that ? 我怎样才能做到这一点 ?

Before visibility 可见之前

在此处输入图片说明

After when subview gets visible 子视图可见后

在此处输入图片说明

Try this: 尝试这个:

[selectorView setFrame:CGRectMake(<CGFloat x> , <CGFloat y>, <CGFloat width>, <CGFloat height>)];

Hope it works for You 希望这对你有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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