suchen

Heim  >  Fragen und Antworten  >  Hauptteil

objective-c - ios7 tableview不显示数据

自定义的cell,若把子控件加在self.contentview上,iOS7和iOS8都不显示数据;若直接加在self上,iOS8显示,iOS7不显示。是什么原因?有解没??

阿神阿神2889 Tage vor291

Antworte allen(3)Ich werde antworten

  • PHPz

    PHPz2017-04-17 17:45:20

    已解决!!!

    iOS7添加在cell.contentView上。ios8添加在cell上;
    重用cell不规范的问题;

    Antwort
    0
  • PHP中文网

    PHP中文网2017-04-17 17:45:20

    虽然你问的问题缺少有用的信息,不过凭直觉猜猜,你是不是在自定义 Cell 时把内容添加到 self 而不是 self.contentView 了?

    [self addSubview:][self.contentView addSubview:] 在 iOS 7 上还是有点区别的。

    Antwort
    0
  • 大家讲道理

    大家讲道理2017-04-17 17:45:20

    用xib试试?

    Antwort
    0
  • StornierenAntwort