Tôi muốn thay đổi màu nền của thanh điều hướng thành màu xanh lá cây đậm.Màu nền thanh điều hướng - mờ là không
Rule: Tôi có thể không gây rối với các appdelegate :)
Tôi đã thử:
//It's green but it's translucent
[self.navigationController.navigationBar setBackgroundColor:[UIColor colorWithRed:77/255.0 green:255/255.0 blue:100/255.0 alpha:1.0f]];
//It's white, first line has no effect
[self.navigationController.navigationBar setBackgroundColor:[UIColor colorWithRed:77/255.0 green:255/255.0 blue:100/255.0 alpha:1.0f]];
[self.navigationController.navigationBar setTranslucent:NO];
//Same result as case 1
[self.navigationController.navigationBar setAlpha:0.0f];
[self.navigationController.navigationBar setBackgroundColor:[UIColor colorWithRed:77/255.0 green:255/255.0 blue:100/255.0 alpha:1.0f]];
//Too dark
[self.navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
[self.navigationController.navigationBar setBackgroundColor:[UIColor colorWithRed:77/255.0 green:255/255.0 blue:100/255.0 alpha:1.0f]];
//Only affects the back button's color:
[self.navigationController.navigationBar setTintColor:[UIColor greenColor]];
Vì vậy, bất kỳ ý tưởng?
Cảm ơn bạn, không thấy có barTintColor và TintColor. Chấp nhận câu trả lời sớm nhất.
didi bạn sử dụng các kịch bản? sau đó chọn bộ điều khiển xem và trong thanh tra theo số liệu mô phỏng đặt thanh trên cùng thành thanh điều hướng mờ – thorb65