关于ios的继承

  • 重写UitextFiled(利用draw,将UitextFiled风格变成一条线)
- (void)drawRect:(CGRect)rect {
 //get the current darwing context
    CGContextRef context = UIGraphicsGetCurrentContext();
//set the fill color with textfiled
    CGContextSetFillColorWithColor(context, [UIColor blackColor].CGColor);
//set the frame 
    CGContextFillRect(context, CGRectMake(0, CGRectGetHeight(self.frame)-0.5, CGRectGetWidth(self.frame), 0.5));
}
  • 继承UIscrollerView可以用来替代写一些很长的页面

你可能感兴趣的:(关于ios的继承)