Я пытаюсь отобразить страницу, как следующийSwift UITableViewCell Alignment
страница заголовка (выравнивание по левому краю)
имяобласть (центр Align)
людей в регионе (подзаголовок с электронной почтой в метка детали)
Но если я выберу субтитры как стиль ячейки, все будет выровнено по левому краю, и я не могу их изменить в коде. Тогда, если я выберу стиль как стиль, detailtextlabel не будет отображаться.
if(poDetailList.LastName == "POName"){
cell.backgroundColor = SharedClass().coopGroupHeaderColor
let selectedColor = UIView()
selectedColor.backgroundColor = SharedClass().coopGroupHeaderColor
cell.selectedBackgroundView = selectedColor
cell.textLabel?.textColor = UIColor.blackColor()
cell.textLabel?.font = UIFont.boldSystemFontOfSize(15.0)
cell.textLabel?.textAlignment = .Center
cell.accessoryType = .None
var t_header = ""
if(POShort != "OTHER" && POShort != "all" && POShort != "invalid"){
t_header = POName
}
else{
t_header = POName
}
cell.textLabel?.text = t_header
cell.detailTextLabel?.text = ""
cell.userInteractionEnabled = false;
} else{
cell.backgroundColor = indexPath.row % 2 == 0 ? UIColor.clearColor() : SharedClass().cellBackGroundColor
let selectedColor = UIView()
selectedColor.backgroundColor = SharedClass().selectedCellColor
cell.selectedBackgroundView = selectedColor
cell.textLabel?.font = UIFont.boldSystemFontOfSize(15.0)
cell.textLabel?.textAlignment = .Left
cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
var t_header = poDetailList.FirstName
cell.textLabel?.text = "Name:" + poDetailList.FirstName + " " + poDetailList.LastName
cell.detailTextLabel?.text = "Not Responded In Days:" + poDetailList.DaysNotResponded
cell.userInteractionEnabled = true;
}
Может ли кто-нибудь помочь мне с этим?
Большое спасибо
вы можете установить только выравнивание текстовой метки не задано detailtextlabel alignment –