【问题标题】:How to animate the images which are stored in sqlite如何对存储在 sqlite 中的图像进行动画处理
【发布时间】:2012-11-17 10:36:33
【问题描述】:

我有一个 UIImageView,我想在其中显示存储在 sqlite 中的一系列动画图像。我该怎么做?

在.h中我喜欢..

         UIImageView *photosImgView;

       @property(nonatomic,retain)IBOutlet UIImageView *photosImgView;

在 .m 中我喜欢..

  @synthesize photosImgView;

    - (void)viewDidLoad
        {
            [super viewDidLoad];

            PeopleTable *ppl = [[People alloc] init];

         photosImgView.animationImages=[NSArray arrayWithArray:ppl.photo]; //(problem is   in this line)

       photosImgView.animationDuration = 5;
      photosImgView.animationRepeatCount = 1;
      [photosImgView startAnimating];

     [self.view addSubview:photosImgView];
 }

请帮助我..提前谢谢...

【问题讨论】:

  • 在 sqlite 中动画图像是什么意思..
  • 我的 sqlite 表中有一组图像,列名是照片,我有 photosImgView 我想要的是我想在这个 photosImgView 中一个接一个地显示这些图像。
  • 那么你能从数据库中获取图像吗..?

标签: iphone sqlite uiimageview


【解决方案1】:

使用FMDB,很简单...

在你的桌子上做一个循环(选择)

NSMutableArray *imgs = [NSMutableArray array];
FMResultSet *s = [db executeQuery:@"SELECT * FROM myTable"];
while ([s next]) {
    [imgs addObject:[s stringForColumn:@"row"]];
}

photosImgView.animationImages=imgs;

完成!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多