Search Results

Search found 2 results on 1 pages for 'lovecactus'.

Page 1/1 | 1 

  • Iphone CATextLayer doesn't show it's text.

    - by lovecactus
    Here is my new bee issue: I was simply trying to add a CATextlayer in an UIView layer. However, according to the following code, I only get the CATextlayer's background color be displayed in the UIView, without any text. Just wonder what did I missed to display the text. Could anyone ofter a hint/sample how to use CATextlayer? Thanks. (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization CATextLayer *TextLayer = [CATextLayer layer]; TextLayer.bounds = CGRectMake(0.0f, 0.0f, 100.0f, 100.0f); TextLayer.string = @"Test"; TextLayer.font = [UIFont boldSystemFontOfSize:18].fontName; TextLayer.backgroundColor = [UIColor whiteColor].CGColor; TextLayer.wrapped = NO; //TextLayer.backgroundColor = [UIColor blueColor]; self.view = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 100.0f)]; self.view.backgroundColor = [UIColor blueColor]; [self.view.layer addSublayer:TextLayer]; [self.view.layer layoutSublayers]; } return self; }

    Read the article

  • shouldAutorotateToInterfaceOrientation always get called more than once.

    - by lovecactus
    (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation My code get this event more than once while device is rotating. I'm searching in apple docs for reference but seems no lucky. Could any one offer a hint why this is happening? My code is an apple doc sample code, without any change but some logs. http://developer.apple.com/iphone/library/samplecode/AlternateViews/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008755

    Read the article

1