我有一个UITableViewCell的自定义子类,并设置了一些约束.
问题是当我尝试更改一个视图的大小时:
CGRect frm = CGRectMake(0, 0, someValue, 30);
cell.indentView.frame = frm;
Run Code Online (Sandbox Code Playgroud)
依赖于cell.indentView宽度的其他视图根本不会移动.
可能是这样的?
此代码将起作用:
// enumerate over all constraints
for (NSLayoutConstraint *constraint in cell.indentView.constraints) {
// find constraint on this view and with 'width' attribute
if (constraint.firstItem == cell.indentView && constraint.firstAttribute == NSLayoutAttributeWidth)
{
// increase width of constraint
constraint.constant = someValue;
break;
}
}
Run Code Online (Sandbox Code Playgroud) 我使用这篇文章制作了标题:StoryBoards中的表头视图
但是我无法在滚动时将标题粘贴(固定)到屏幕顶部.
怎么能实现呢?
PS表风格很简单,当我厌倦了超载viewForHeaderInSection并返回标题视图的插座时,它变得更糟.
提前致谢!
我的android-sdk-windows\tools目录中缺少层次结构查看器工具.
链接到工具:http: //developer.android.com/guide/developing/tools/hierarchy-viewer.html
应该是第一名吗?
PS SDK工具版.7,安装平台7和8包.