-1
我跟着UISwitch in a UITableView cell將UISwitch放入tableview中。下面是代碼:編輯模式下的UITableView單元中的UISwitch
UISwitch *mySwitch = [[UISwitch alloc] init];
cell.accessoryView = mySwitch;
但問題是,當我把表進入編輯模式:
self.tableView.editing = YES;
的UISwitch自敗。
你知道我該如何解決這個問題?
好的,這回答了我的問題,所以我會盡我所能給你(我必須再等7分鐘)。我不知道有關contentView。謝謝! – Jan
嘿@abhishekkharwar你可以看看這個問題:http://stackoverflow.com/questions/18438459/how-to-properly-position-a-uitableview-cell-subview-to-the-right它遵循你的建議但我遇到了另一個問題?謝謝! – Jan
您是否嘗試在uiswitch上添加autoresizingmask?嘗試添加UIAutoresizingMaskLeft,然後讓我知道 – abhishekkharwar