0

私は初心者で、データベースから画像を取得するフルスクリーン画像スクロールビューを持つプログラムを開発しました。しかし、出力に空白(白)の画像が表示されます。その背後にある理由は何ですか?plzヘルプ、私のコードは次のとおりです。

@interface GalleryImageScrollViewController ()
{
    MyDatabase *data;
    NSMutableArray *slideImages;
    CGPoint gestureStartPoint,currentPosition;
}
-(void)putImageViewsInScrollView:(int) numberOfImageViews;
@end

@implementation GalleryImageScrollViewController


- (void)viewDidLoad
{
    [super viewDidLoad];
      self.FullScreenImageScroller.delegate= self;
    [self putImageViewsInScrollView:slideImages.count];



}


-(void) putImageViewsInScrollView:(int)numberOfImageViews
{
    data=[MyDatabase new];
    slideImages=[data OpenMyDatabase:@"SELECT pic_name FROM interior" :@"pic_name"];

      for(int i=0 ;i< numberOfImageViews; i++)
    {





UIImageView *fullScreenImageView = [[UIImageView alloc] init];
        fullScreenImageView.frame = CGRectMake((WIDTH_OF_IMAGE * i)  , 0, WIDTH_OF_IMAGE, HEIGHT_OF_IMAGE);
        fullScreenImageView.image = [UIImage imageNamed:[slideImages objectAtIndex:i]];
        [self.FullScreenImageScroller addSubview:fullScreenImageView];
        }

        [self.FullScreenImageScroller setContentSize:CGSizeMake(WIDTH_OF_SCROLL_PAGE * ([slideImages count]), HEIGHT_OF_IMAGE)];
        [self.FullScreenImageScroller setContentOffset:CGPointMake(0, 0)];
        [self.FullScreenImageScroller scrollRectToVisible:CGRectMake(WIDTH_OF_IMAGE,0,WIDTH_OF_IMAGE,HEIGHT_OF_IMAGE) animated:NO];

}
4

1 に答える 1

0

これを試して

@interface GalleryImageScrollViewController ()
{
MyDatabase *data;
NSMutableArray *slideImages;
CGPoint gestureStartPoint,currentPosition;
}
-(void)putImageViewsInScrollView:(int) numberOfImageViews;
@end

@implementation GalleryImageScrollViewController


- (void)viewDidLoad
{
 [super viewDidLoad];
  slideImages = [[NSArray alloc]init];
  data=[[MyDatabase alloc]init];
  slideImages=[data OpenMyDatabase:@"SELECT pic_name FROM exterior" :@"pic_name"];
  [self putImageViewsInScrollView:slideImages.count];
  self.FullScreenImageScroller.delegate=self;
  NSLog(@"Array %@",slideImages);
 }

 -(void) putImageViewsInScrollView:(int)numberOfImageViews
 {
   for(int i=0 ;i< numberOfImageViews; i++)
  {
    UIImageView *fullScreenImageView = [[UIImageView alloc] init];
    fullScreenImageView.frame = CGRectMake((WIDTH_OF_IMAGE * i)  , 0, WIDTH_OF_IMAGE, HEIGHT_OF_IMAGE);
    fullScreenImageView.image = [UIImage imageNamed:[slideImages objectAtIndex:i]];
    [self.FullScreenImageScroller addSubview:fullScreenImageView];
    }

    [self.FullScreenImageScroller setContentSize:CGSizeMake(WIDTH_OF_SCROLL_PAGE * ([slideImages count]), HEIGHT_OF_IMAGE)];
    [self.FullScreenImageScroller setContentOffset:CGPointMake(0, 0)];
    [self.FullScreenImageScroller scrollRectToVisible:CGRectMake(WIDTH_OF_IMAGE,0,WIDTH_OF_IMAGE,HEIGHT_OF_IMAGE) animated:NO];
    }
于 2013-03-04T05:51:08.963 に答える