我想要做的是,当我点击特定单元格时,应该更改与单元格对应的标题的标题.
我使用-tableVIEw:vIEwForheaderInSection设置了节头:
如何在-tableVIEw:dIDSelectRowAtIndexPath:方法中获取行标题标题?
解决方法 我建议实现tableVIEw:TitleForheaderInSection:和tableVIEw:vIEwForheaderInSection :(如果两者都实现,那么iOS更喜欢vIEwForheaderInSection :).然后让你的tableVIEw实现:vIEwForheaderInSection:用标签创建它的视图,并用tableVIEw的结果填充它:TitleForheaderInSection ::- (UIVIEw *)tableVIEw:(UItableVIEw *)tableVIEw vIEwForheaderInSection:(NSInteger)section UIVIEw *yourheaderVIEw; UILabel *someLabel; // set up the vIEw + label // if self doesn't implement UItableVIEwDelegate,you can use tableVIEw.delegate someLabel.text = [self tableVIEw:tableVIEw TitleForheaderInSection:section]; return yourheaderVIEw;}
现在,当您回答行敲击时,很容易获得相应的标题:
- (voID)tableVIEw:(UItableVIEw *)tableVIEw dIDSelectRowAtIndexPath:(NSIndexPath *)indexPath { Nsstring *TitleForheader = [self tableVIEw:tableVIEw TitleForheaderInSection:indexPath.section];}总结
以上是内存溢出为你收集整理的ios – 选择单元格时如何获取节标题视图的标题全部内容,希望文章能够帮你解决ios – 选择单元格时如何获取节标题视图的标题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)