我刚刚将我的Xcode ver从7.3更新到8.0,并且一些按钮边框消失了.
代码看起来很好,所以我真的不知道层发生了什么.顺便说一句 - 在其他一些控制器中我可以看到图层边框.
self.button.layer.borderColor = borderColor.CGColor;
self.button.layer.borderWidth = 2;
self.button.layer.cornerRadius = CGRectGetHeight(self.button.frame) / 2;
Run Code Online (Sandbox Code Playgroud)
之前:(图像只是例如 - 边框实时看起来不同)
现在:
我在另一个函数中有一些函数.在function1中我想使用NSTimer在一段时间之后调用func2,如下所示:
func myFunc1()
{
NSTimer.scheduledTimerWithTimeInterval(1, target: ??, selector:#selector(myFunc2()), userInfo: nil, repeats: false)
func myFunc2()
{
// do something...
}
}
Run Code Online (Sandbox Code Playgroud)
我应该通过哪个正确的"目标"价值?它甚至可能吗?
我正在使用此代码来生成具有自动调整大小的动态UITextView
- (void)textViewDidChange:(UITextView *)txtView
{
CGRect frame;
frame = txtView.frame;
frame.size.height = [textView contentSize].height;
textView.frame = frame;
}
Run Code Online (Sandbox Code Playgroud)
代码很好,但是当我按下键盘上的"返回"(断行)时,我需要textView向上增长方向,而不是像现在这样向下.
我尝试用"CGRectGetMaxY(textView.frame)"做一些事情,因为我知道textView的底部需要保持原样而不是改变,但我找不到正确的方法.
这个textView用于聊天消息的输出,所以如果用户写的东西很长,那么textView需要长大,因为键盘是波纹管
ios ×5
objective-c ×2
swift ×2
xcode ×2
debugging ×1
iphone ×1
nstimer ×1
uibutton ×1
uitextview ×1
xcode8 ×1