, burada programlı yapmak nasıl.
bir UIView alt sınıfı oluşturun ve aşağıdaki
drawRect:
geçersiz:
#define PADDING 4.f //give the canvas some padding so the ends and joints of the lines can be drawn with a mitered joint
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor grayColor].CGColor);
CGContextSetLineWidth(context, 3.f);
CGContextSetLineJoin(context, kCGLineJoinMiter);
CGContextMoveToPoint(context, PADDING, PADDING);
CGContextAddLineToPoint(context, self.frame.size.width - PADDING, self.frame.size.height/2);
CGContextAddLineToPoint(context, PADDING, self.frame.size.height - PADDING);
CGContextStrokePath(context);
}
Bu stok gösterge okunu çeker. vb rengi, çizgi kalınlığı, değiştirebilir Buradan
Hücrene gösterge görünümü eklemek için:
#define ACCESSORY_WIDTH 13.f
#define ACCESSORY_HEIGHT 18.f
cell.accessoryView = [[AccessoryIndicatorView alloc] initWithFrame:CGRectMake(self.frame.size.width - ACCESSORY_WIDTH - CELL_PADDING, self.frame.size.height/2 - ACCESSORY_HEIGHT/2, ACCESSORY_WIDTH, ACCESSORY_HEIGHT)];
Eski sorusunun rengini değiştirmek de dahil olmak üzere pek çok farklı şekilde yardımcı olacaktır, ancak henüz tatmin edici bir yanıt almadı. İşte burada * aslında * sordu: http://stackoverflow.com/a/35427683/378024 – galambalazs