2016-11-28 6 views
1

Layout without header background相殺テキスト

Layout with header background so you can see its centered

イムはデザインを中心に表示されますが、それは高いに置かれているようので、細胞内でトップのスペースを、それが見えます。どのようにすべての画面サイズで表示させることができますか?私はポイントでオフセットを使うと心配しました。大きなスクリーンではオフセットが小さ過ぎ、小さなスクリーンでは大きなオフセットになりますか?

現在、私はこのようにそれにそれを実行します。

func adjustLayoutToFrame(){ 
     let screenSize = UIScreen.main.bounds 
     let screenHeight = screenSize.height 
     let cellHeight = screenHeight/9 
     let headerHeight = cellHeight*2 

     weekHeaderLabel.frame.size.height = headerHeight 
     print("header height set to:", headerHeight) 
     cellHeightForDevice = cellHeight 

     //weekHeaderLabel.backgroundColor = .blue 

    } 

答えて

0

代わりedgeInset値の改ざんの、

移動に次のようにパディングを削除しよう - YouStoryboard.storyboard> YourViewController>は、インスペクタ>のチェックを外し属性は、 - スクロールビューのインセットを調整します。

enter image description here

+0

これを行うと本当に何が起こりますか?なぜ、edgeInset値を改ざんするよりも良いのですか? –

関連する問題