2017-05-29 1 views
-2

私は2つのセルを持つテーブルビューを持っています。何らかの理由でシミュレータで開いたときにセルのサイズが変更されます。理由を理解しようとしています。私はビューのイメージを追加しました。なぜ私のテーブルビューのセルはリサイズですか

これはビューコードです。今の私はちょうどこれは私が探していたものであるIB

に私が設定高さで作成された取得するために、細胞
import UIKit 

class userMenuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate { 

var surveyNameArr = ["aaa","bbb","ccc"] 

public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int 
{ 
    return (surveyNameArr.count) 
} 

public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell 
{ 

    let cell = tableView.dequeueReusableCell(withIdentifier: "cell2", for: indexPath) as! PrefCell2TableViewCell 



    return (cell) 

} 



public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){ 

} 


override func viewDidLoad() { 
    super.viewDidLoad() 

    // Do any additional setup after loading the view. 
    addSlideMenuButton() 
} 

override func didReceiveMemoryWarning() { 
    super.didReceiveMemoryWarning() 
    // Dispose of any resources that can be recreated. 
} 


/* 
// MARK: - Navigation 

// In a storyboard-based application, you will often want to do a little preparation before navigation 
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 
    // Get the new view controller using segue.destinationViewController. 
    // Pass the selected object to the new view controller. 
} 
*/ 

} 

image of cells in table this is the image of my view

+0

詳細を提供します。誰でもあなたのスクリーンショットを見て分かるように。ストーリーボードやコードで何をしたのか教えてください。あなたが何をやったのか教えてください。 –

答えて

1

を望む:

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat 
{ 
    return 100.0;//Choose your custom row height 
} 
関連する問題