小编Ego*_*gor的帖子

在以编程方式更改视图维度时,Autolayout似乎无法正常工作

我有一个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)

iphone uitableview ios autolayout

12
推荐指数
1
解决办法
6709
查看次数

使用Storyboard时如何使UITable标题贴在屏幕顶部?

我使用这篇文章制作了标题:StoryBoards中的表头视图

但是我无法在滚动时将标题粘贴(固定)到屏幕顶部.

怎么能实现呢?

PS表风格很简单,当我厌倦了超载viewForHeaderInSection并返回标题视图的插座时,它变得更糟.

提前致谢!

xcode storyboard uitableview ios

7
推荐指数
2
解决办法
2万
查看次数

缺少Android Hierarchy查看器

我的android-sdk-windows\tools目录中缺少层次结构查看器工具.

链接到工具:http: //developer.android.com/guide/developing/tools/hierarchy-viewer.html

应该是第一名吗?

PS SDK工具版.7,安装平台7和8包.

android android-layout

1
推荐指数
1
解决办法
2042
查看次数