简体   繁体   English

如何使UIView子视图不滚动

[英]How to make a UIView subview NOT scroll

I have a subview over my UITable that is used as a "busy view". 我在UITable上有一个子视图,用作“繁忙视图”。 It holds an activity indicator and labels. 它包含一个活动指示器和标签。 I call it when the program is going to download a photo that is indexed in the cell. 我在程序要下载在单元格中建立索引的照片时调用它。 All that works fine but the problem is that when I'm scrolling down the UITable and then click on a cell and the "busy view" gets added it will show up at the top of the screen or off the screen because it scrolled up too. 一切正常,但问题是当我向下滚动UITable然后单击一个单元格并添加“忙碌视图”时,它将显示在屏幕顶部或屏幕外,因为它也向上滚动。 How can I keep the second subview from scrolling and stay in place in the center of the screen? 如何防止第二个子视图滚动并停留在屏幕中央? I've tried the "center" property and that doesn't help. 我已经尝试过“中心”属性,这没有帮助。

Thanks 谢谢

Don't add the 'busy view' to the table view, add it to the window. 不要将“忙碌视图”添加到表格视图,而是将其添加到窗口。 This will place it above everything else onscreen: 这会将其置于屏幕上的所有其他内容之上:

[self.view.window addSubview: busyView];

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

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