In my app, I have a table view that I have managed so far with storyboards (I have added sections:rows:cells, etc.. all via storyboards), the only change I have made programmatically was to add a UIButton
as one of the sections headers by implementing:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if (section == 2) {
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 64)];
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button1 setTitle:@"Hydro Volume" forState:UIControlStateNormal];
button1.frame = CGRectMake(62.5, 5, 205, 44);
[view addSubview:button1];
[button1 addTarget: self
action: @selector(buttonClicked:)
forControlEvents: UIControlEventTouchDown];
return view;
}
return nil;
}
My current dilemma is that I have to add a section header that contains subscripts, i.e.: H2O
I am unable to just add the subscript directly in the storyboard inspector, can someone tell me what is the way to do this?
I reviewed this question, but it's not quite what I am looking for as I need to be able to add it to my section header.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…