私は今 、quickdialogボックス
![enter image description here](https://i.stack.imgur.com/z60jy.png)
私は今 、quickdialogボックス
は、これを試してみてください:
tableView.backgroundColor = [UIColor colorWithPattern:@"your_image_here"];
または
tableView.backgroundColor = [UIColor colorWithRed:128 green:128 blue:128 alpha:1.0];
を、これは動作しない場合は、テーブルのbackgroundView
プロパティを設定することができます表示:
tableView.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"your_image_here"]]] autorelease];
backgroundView
UITableView
のプロパティ
イメージを使用する場合は、UIImageView
を作成し、backgroundView
に設定してください。
UIImage *myImage = [UIImage imageNamed:@"foo.png"];
self.tableView.backgroundView = [[UIImageView alloc] initWithImage:myImage];
また、画像がビューにどのように適合するかを調整するためにcontentMode
を使用することができます。
self.tableView.backgroundView.contentMode = UIViewContentModeScaleAspectFill;
あなたはUITableView
が継承するかを宣言いずれかのプロパティの一部を試みることができる:
@property(nonatomic, readwrite, retain) UIView *backgroundView
@property(nonatomic, copy) UIColor *backgroundColor
最初は、あなたがしたいしようとしているだろうものです。これはUITableView
によって宣言されています。 2番目はUIView
から継承されています。
テーブルビューの背景色を設定してください。テーブルビューのスタイルをgroupedからplainに変更する必要があります。
あなたは、背景色を設定している場合はこれを試して...
tableView.backgroundView = nil;
tableView.backgroundColor = [UIColor redColor]; //replace with your colour
しかし、あなたはパターン画像をしたい場合は、そのメソッドを使用していない...これを行います。..
tableView.backgroundColor = [UIColor clearColor];
UIView *v = [[UIView alloc] init]; //needs memory Managment (arc example)
v.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"pattern.png"]];
tableView.backgroundView = v;
これは、UITableViewがグループスタイルになっていて、tableviews backgroundColorとしてパターン化された背景イメージを持っていて、それがセルのエッジにも適用されているため、別々のビューであるためパターンが正しくないからです。
希望します。
私はのUITableViewの背景を変更する方法をカバーし、次のスクリーンキャストを見てみましょう:
http://www.youtube.com/watch?v=B2kbxWzJLVM&list=PL1E1FF3F73A3279CF&index=18&feature=plpp_video
を