亲爱的程序员,自定义的UILabel创作,以避免本地化问题
我创建一个customLabel类象下面这样:
@interface CustomLabel : UILabel {
NSString *customBundlePath;
}
@implementation CustomLabel
- (void)drawTextInRect:(CGRect)rect
{
NSString *result=[self getLocalvalue:self.text];
[result drawInRect:rect withFont:self.font];
}
-(void)awakeFromNib
{
NSLog(@"%@",self.text);
}
-(NSString *)getLocalvalue:(NSString*)textTolocalize
{
// some code
return localizedText;
}
但我的问题是,drawTextInRect方法在的时候一个标签调用一次笔尖加载。
如果视图再次出现popig,那么将为每个customLabel对象执行哪个方法?
请帮我一把。 提前致谢。
只是为了本地化,你不必创建自定义标签。 – Satyam
但我在我的应用程序中有这么多的意见。所以我需要它先生萨蒂扬 –
做ViewWillApper方法 –