親愛的程序員,自定義的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方法 –