0

Need some help to show the custom cell in UITableView on the bottom with button inside. I have added this but it not be shown in the simulator :( I dont know more.. see the attached image to understand the problem. BIG THANK!

http://www.otrada.de/Not-show-button.png

2 Answers 2

1

i think you problem is caused by the cell height; you should implement this method:

optional func tableView(_ tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat{} 

and return an appropriate height, i'm fairly sure your button is under the cell frame :)

Sign up to request clarification or add additional context in comments.

2 Comments

but how can I take it over the cell-frame? :) The solution with the hight not help. The hight is ok.
can you please write us what is the cell height frame in storyboard or xib? after that you should write inside that method i wrote you the same value.
0

You will need to create a custom cell from a UITableViewCell.

class MyCustomCell: UITableViewCell {
    // Map the action.
    @IBAction func buttonPressed (sender: UIButton) {
        // Do your stuff here when the button is pressed.
    }

}

Once you do that, you need to go to storyboard and change the class name from UITableViewCell to MyTableViewCell in identity inspector.

If you don't know what identity inspector is, refer https://developer.apple.com/library/ios/recipes/xcode_help-general/Chapters/AbouttheUtilityArea.html

1 Comment

:( Its not the problem. I dont see the button with this custom-cell. I have added the class to the cell but it not resolv the problem. otrada.de/no_logout_button_2.png

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.