I’m a beginner in iOS development and I have to put in the same UITableViewCell a label (on the left), a subtitle (on the right) and a slider in the middle.
For now the Label and subtitle are in a cell above the slider.
Is there any way to do that ?
Thanks in advance.
I’m a beginner in iOS development and I have to put in the same
Share
Yes are you using StoryBoards? if so change the cell Style to Custom then drag the other elements into the cell place them were ever you want.
Make sure you set the cell identifier name
May sure you set the tag value to get to them later in the cellForRowAtIndexPath
Example:
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:”stateCell” forIndexPath:indexPath];
UILabel *stateLabel = (UILabel *)[cell viewWithTag:1000];
StateProvince *myState = [self.states objectAtIndex:indexPath.row];
stateLabel.text = myState.label;
}