基本的な質問を申し訳なく思っています。私のデバイスを回転させると、私のIBOutletsを@propertyおよび@synthesizeで変更しないように、私は私のコードを下に提供しました。私はちょうど私のIBOutlets.Isのために私の画像とフレームを変更しています?オリエンテーション変更メモリが増加している間に
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){
for(UIImageView *thumbImage in [tableSupportView subviews]){
UIImage *tempImage=[bookListDataSource bookAtIndex:thumbnilIndex].titleImage;
CGFloat thumbnilHeight=95*((float) tempImage.size.height/tempImage.size.width);
thumbImage.frame=CGRectMake(thumbnilIndex*125, (205-thumbnilHeight)/2, 95, thumbnilHeight);
thumbnilIndex++;
}
self.myoutlets.frame=cgrect(frames according to criteria);
NSString *detailImagePath=[[NSBundle mainBundle] pathForResource:@"details_bg_nb" ofType:@"png"];
UIImage *detailImage=[[UIImage alloc] initWithContentsOfFile:detailImagePath];
UIColor *bookDetailViewColor=[[UIColor alloc] initWithPatternImage:detailImage];
self.bookDetailView.backgroundColor=bookDetailViewColor;
[bookDetailViewColor release];
[detailImage release];
NSString *listBGImagePath=[[NSBundle mainBundle] pathForResource:@"list_bg_nb" ofType:@"png"];
UIImage *listBGImage=[[UIImage alloc] initWithContentsOfFile:listBGImagePath];
UIColor *listHeaderContainerViewColor=[[UIColor alloc] initWithPatternImage:listBGImage];
self.listHeaderContainerView.backgroundColor=listHeaderContainerViewColor;
[listHeaderContainerViewColor release];
[listBGImagePath release];
NSString *listBandPath=[[NSBundle mainBundle] pathForResource:@"listband_potrait" ofType:@"png"];
UIImage *listBand=[[UIImage alloc] initWithContentsOfFile:listBandPath];
self.categoryBrandingImageView.image=listBand;
[listBand release];
}else {
NSUInteger thumbnilIndex=0;
NSUInteger numberOfBooks=[bookListDataSource numberOfBooks];
for(UIImageView *thumbImage in [tableSupportView subviews]){
UIImage *tempImage=[bookListDataSource bookAtIndex:thumbnilIndex].titleImage;
CGFloat thumbnilHeight=85*((float) tempImage.size.height/tempImage.size.width);
thumbImage.frame=CGRectMake(thumbnilIndex*115, (CGRectGetHeight(tableSupportView.frame)-thumbnilHeight)/2.0, 85, thumbnilHeight);
thumbnilIndex++;
}
}
self.myoutlets.frame=cgrectmake(my custom frame);
NSString *detailImagePath=[[NSBundle mainBundle] pathForResource:@"landscape_details_bg_nb" ofType:@"png"];
UIImage *detailImage=[[UIImage alloc] initWithContentsOfFile:detailImagePath];
UIColor *bookDetailViewColor=[[UIColor alloc] initWithPatternImage:detailImage];
self.bookDetailView.backgroundColor=bookDetailViewColor;
[bookDetailViewColor release];
[detailImage release];
NSString *listBGImagePath=[[NSBundle mainBundle] pathForResource:@"landscape_list_bg_nb" ofType:@"png"];
UIImage *listBGImage=[[UIImage alloc] initWithContentsOfFile:listBGImagePath];
UIColor *listHeaderContainerViewColor=[[UIColor alloc] initWithPatternImage:listBGImage];
self.listHeaderContainerView.backgroundColor=listHeaderContainerViewColor;
[listHeaderContainerViewColor release];
[listBGImagePath release];
NSString *listBandPath=[[NSBundle mainBundle] pathForResource:@"listband_landscape" ofType:@"png"];
UIImage *listBand=[[UIImage alloc] initWithContentsOfFile:listBandPath];
self.categoryBrandingImageView.image=listBand;
[listBand release];
}
self.bookInformation.backgroundColor=[UIColor clearColor];
self.bookDescrption.backgroundColor=[UIColor clearColor];
}
}
任意の漏れがない場合には、事前に私にsolution.Thanksが提供してくださいです。
聖ブロックの代わりにバットマンを
listBGImage
を解放する必要があります! –