简体   繁体   中英

UIButton not visible in TableView Cell

I have parsed CSV file data and populating in a UITableView. I have five labels and a button in the cell. The labels are showing data appropriately but the button is not visible. I have dragged the button onto the storyboard. I have created a outlet variable also. But still the button is not visible. What could be the reason ?

Even when i change the position of my label now and run the app it doesn't change. Does this have something to do with core-data ? Because i have saved my csv data as core-data

Hit the runtime UI debugger key when in the considering VC is showing. The button should be above the console panel the second last one. Right now am not in my mac so cant post a screenshot.

Hit the button and observe that your button is being drawn beneath some view or your button is being drawn at all. Plz confirm and comment

I suggest you to apply auto layout constraints for button and labels. I think it will work.

REASON: your label is over your button. If you don't use auto layout label width get width of tableView (least the initial position x) and background default to white AUTO when your app running.

Change in code the label background to 'clear' and button will appear or search the button in the cell and use method 'bringSubviewToFront:'.

BEST SOLUTION? Use auto layout constraints.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM