2016-11-09 1 views
0

ここに見られるように、私は間隔の問題のビットを持っています(私の悪い描画スキルすみません:\)テーブルビューヘッダーテキスト問題

Bad Drawing Example + Spacing Issue

誰がどのようにこの間隔の問題を修正する方法を教えてもらえますか?

override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { 
     let headerText = UILabel() 
     headerText.textColor = UIColor.darkGrayColor() 
     switch section{ 
     case 0: 
      headerText.textAlignment = .Right 
      headerText.text = "הבר המועדף עליכם חסר? שתפו אותנו ונוסיף" 
     case 1: 
      headerText.textAlignment = .Right 
      headerText.text = "יש לכם רעיון לשיפור האפליקציה? שתפו אותנו :)" 
     default: 
      headerText.textAlignment = .Right 
      headerText.text = "" 
     } 
     //Any Other Customizations 

     return headerText 
    } 
} 

答えて

1

heightForHeaderInSectionデリゲートメソッドを実装し、所望の高さを返します。私は、それに対する解決策を見つけることができません...ここに私のコードです。

func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { 
    return 35.0//write here your desired value. This will be your table's header height 
} 
+0

ありがとう、私はすぐにそれを試します。 –