簡體   English   中英

更改 uitabbar 背景顏色

[英]change uitabbar background color

我正在編寫此代碼,但警告顯示“insertSubview”可能沒有響應

- (void)viewDidLoad {

    [super viewDidLoad]; 

    CGRect frame = CGRectMake(0, 0, 480, 49);

    UIView *v = [[UIView alloc] initWithFrame:frame];

    UIImage *i = [UIImage imageNamed:@"GO-21-TabBarColorx49.png"];

    UIColor *c = [[UIColor alloc] initWithPatternImage:i];

    v.backgroundColor = c;

    [c release];

    [[self tabBar] addSubview:v];

    [v release];

}

你試過了嗎

[[self tabBar] insertSubview:v atIndex:0];

而不是addSubview:

來源: 更改 UITabBar 的色調/背景顏色

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM