funktioniert nicht korrekt. addSubview problem

Mir helfen.
addSubview nicht funktioniert.
Ich möchte hinzufügen "ContentView" auf scrollView.
Aber "ContentView" erscheint nicht auf dem Bildschirm.
"ContentView" ist UIView.

Wenn ich auf selbst.view=scrollView von [self.view addSubview:scrollView],
addSubview nicht funktioniert.

Bitte mir beibringen, wie man hinzufügen UIView auf diesem Bildschirm!!

- (void)viewDidLoad {
[super viewDidLoad];

scrollViewMode = ScrollViewModeNotInitialized;
mode = 1;
imageViewArray = [[NSMutableArray alloc] init]; 
mainStatic = [[MainStatics alloc] init];    
[mainStatic setSetting];
NSString* path = [[NSBundle mainBundle] pathForResource:@"Files" ofType:@"plist"];      
NSArray* dataFiles = [NSArray arrayWithContentsOfFile:path];    
kNumImages = [dataFiles count]; 

CGRect frame = [UIScreen mainScreen].applicationFrame;
scrollView = [[touchClass alloc] initWithFrame:frame];
scrollView.delegate = self;
scrollView.maximumZoomScale = 5.0f;
scrollView.minimumZoomScale = 1.0f;
[scrollView setBackgroundColor:[UIColor blackColor]];
[scrollView setDelegate:self];
scrollView.delaysContentTouches=NO;
scrollView.userInteractionEnabled = YES;
[scrollView setCanCancelContentTouches:NO];

NSUInteger i;                                                   
for (i=0;i<[dataFiles count];i++)
{
    UIImage* image = [UIImage imageNamed:[dataFiles objectAtIndex:i]];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.contentMode = UIViewContentModeScaleAspectFit;                
    imageView.userInteractionEnabled = NO;                                  
    CGRect rect = imageView.frame;                                          
    rect.size.height = 480;                                 
    rect.size.width = 320;                                      
    imageView.frame = rect;                                                 
    imageView.tag = i+1;                                                                       
            [imageViewArray addObject:imageView];
}

self.view = scrollView;

[self setPagingMode];
UIView* contentView;                                            
CGRect scRect = CGRectMake(0, 436, 320, 44);                    
contentView = [[UIView alloc] initWithFrame:scRect];
[contentView addSubview:toolView];                              
[self addSubview:contentView];                              

}

InformationsquelleAutor kyoheialfaromeo2010 | 2010-06-03

Schreibe einen Kommentar