Kir*_*ari 0 iphone objective-c ios
我有一个UITableView.
该UITableView包含
UITextView UICollectionView UILabel 现在,我希望得到所有UILabel的superView.
怎么做?
小智 6
您可以使用以下代码获取TextView的所有子视图:
for(UIView * subView in myTextView.subviews ) // here write Name of you TextView
{
// Here You can Get all subViews of your TextView.
// But For Check subview is UILabel or not ? write following code also.
if([subView isKindOfClass:[UILabel class]]) // Check is SubView Class Is UILabel class
{
// You can write code here for your UILabel;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1353 次 |
| 最近记录: |