2016-11-09 55 views
1

似乎xcode8.0在設置storyboard時沒有設置用戶運行時屬性的值。試圖做的很簡單,將標籤內的標籤設置爲corneRadius 10其中有20的寬度/高度。當我嘗試調試的意見,我得到了以下輸出有奇怪的寬度高度(1000/1000 ..?)UserDefine運行時屬性在Xcode8.0中不起作用

_UILabelLayer:0x600000283750;職位= CGPoint(500 500);邊界= CGRect(0 0; 1000 1000);委託=>;不透明=是; allowedGroupOpacity = YES; cornerRadius = 10; contentsMultiplyColor =(null); rasterizationScale = 2; contentsScale = 2>

enter image description here

enter image description here

+0

更大的問題是調整大小的錯誤。我建議你就此提交一份錯誤報告...... –

+0

好吧,我會這麼做的.. – iSwift

回答

1

我認爲這是對你有幫助。

enter image description here

,並檢查clipToBounds

enter image description here

檢查 「剪輯子視圖」 等於代碼addMessageLabel.clipsToBounds = YES;

0

您可以使用此代碼和方法,您的控制器

override func viewDidLayoutSubviews() { 
      super.viewDidLayoutSubviews() 
      yourLabel.clipsToBounds = true 
      yourLabel.layoutIfNeeded() 
      print("Frame ------> ",yourLabel.frame) 
    }