开发者

MobileSafari UILabel

I was wondering how the UILabel that displays the website's title in Mobile Safari is created? It's obviously some kind of a subclass and I've attempted to copy it by using my own subclass,but it just doesn't look the same. I also don't know which font they're using :/ Could anyone help me out please? :)

here's my class:

 CGSize shadowOffset = self.shadowOffset;
 UIColor *textColor = self.textColor;

 CGContextRef c = UIGraphicsGetCurrentContext();
 CGContextSetLineWidth(c, 1);

 CGC开发者_运维百科ontextSetTextDrawingMode(c, kCGTextStroke);
 self.textColor = [UIColor grayColor];
 [super drawTextInRect:rect];

 CGContextSetTextDrawingMode(c, kCGTextFill);
 self.textColor = textColor;
 self.shadowOffset = CGSizeMake(0, 0);
 [super drawTextInRect:rect];

 self.shadowOffset = shadowOffset;


Looks like a basic UILabel with a shadow offset of (0, 1). The only hard part is finding the exactly font and colors that they use. I'm guessing it's just the boldSystemFont with a dark blue font color, and white shadow. You really don't need a subclass for this.

Edit: UILabel: http://img823.imageshack.us/img823/1281/photo1w.png Mobile Safari Comparison: http://img840.imageshack.us/img840/1538/photo2q.png

I just used the colors given in the interface builder, which are Tungsten (a dark gray) for the text, and Silver (a lighter gray) for the shadow.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜