访问iOS 7隐藏的UITableViewCellScrollView? [英] Access iOS 7 hidden UITableViewCellScrollView?

查看:115
本文介绍了访问iOS 7隐藏的UITableViewCellScrollView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple在iOS 7中更改 UITableViewCell 层次结构

Apple change the UITableViewCell hierarchy in iOS 7

使用iOS 6.1 SDK

Using iOS 6.1 SDK

<UITableViewCell>
   | <UITableViewCellContentView>
   |    | <UILabel>

使用iOS 7 SDK

Using iOS 7 SDK

<UITableViewCell>
   | <UITableViewCellScrollView>
   |    | <UITableViewCellContentView>
   |    |    | <UILabel>

我的问题是 UITableViewCellScrollView.layer.masksToBounds = TRUE 默认情况下,我需要它是假的。

My problem is that the UITableViewCellScrollView.layer.masksToBounds = TRUE by default and i need it to be false.

我尝试了以下内容:

UIView * scrollView = [self.subviews objectAtIndex:0];
scrollView.layer.masksToBounds = NO;

[self.myLabel.superview.layer setMasksToBounds:NO];

但是没有更改 UITableViewCellScrollView
如何访问此滚动视图?

But non of them changes the UITableViewCellScrollView. How can i access this scrollview?

推荐答案

访问新CellScrollView的唯一方法是访问单元格superview在它创建之后。

The only way to access the new CellScrollView is by accessing the cell superview after it was created.

我添加了以下 cellForRowAtIndexPath

cell = [[UICustomTableViewCell alloc] init];
UIView *cellScrollView = cell.myLabel.superview;
[cellScrollView.layer setMasksToBounds: NO];

我认为Apple应该为我们提供一种方法来访问这个新的ScrollView而无需黑客攻击。

I think Apple should give us a way to access this new ScrollView without hacking.

这篇关于访问iOS 7隐藏的UITableViewCellScrollView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆