TTTabBar icon indicating copy to clipboard operation
TTTabBar copied to clipboard

Background color issues

Open jekahy opened this issue 9 years ago • 6 comments

When I set tabBarHeight equal to 50, there is a small transparent tile in the bottom. It seems to me that the tab view, or some background view has fixed height, that it not being updated. Please see the pic: 2016-02-29 23 10 16

jekahy avatar Feb 29 '16 21:02 jekahy

Hi jekahy, which view are you putting the background color? Could you post your code?

Edig avatar Feb 29 '16 21:02 Edig

Hi Edig, here is my code:

`class TabBarVC: TTTabBar{

override func viewDidLoad() {
    super.viewDidLoad()

    self.tabBarHeight = 50

    let tabModel1 = TabItemStruct(vcName: "FeedNav", imgName: "main_menu", selImgName
        : "main_menu")
    let tabModel2 = TabItemStruct(vcName: "categoriesVC", imgName: "categories_menu", selImgName: "categories_menu")
    let tabModel3 = TabItemStruct(vcName: "mapVC", imgName: "pin_menu", selImgName: "pin_menu")
    let tabModel4 = TabItemStruct(vcName: "mapVC", imgName: "user_icon", selImgName: "user_icon")

    self.tabBarItems = createItemsWithImgs([tabModel1, tabModel2, tabModel3, tabModel4])
    self.tabBackgroundColor =UIColor(red: 176.0/256.0, green: 182.0/256.0, blue: 187.0/256.0, alpha: 1.0)

    self.updateTabBarView()

}`

jekahy avatar Feb 29 '16 21:02 jekahy

@jekahy I just update the code, install it again and let me know if it works

Edig avatar Feb 29 '16 21:02 Edig

I had to make methods public because the code didn't compile. I have the same code and the issue is there.

jekahy avatar Feb 29 '16 21:02 jekahy

I modify this line

tabBarHeight = defaultTabBarHeight

to

if (tabBarHeight == 0) {
     tabBarHeight = defaultTabBarHeight
}

IF not let me create a sample app and try it

Edig avatar Feb 29 '16 21:02 Edig

The problem is not solved. I think the reason of the bug is that tabBarHeight is being set in viewDidLoad method of TTTabBar. tabBarHeight property of TTTabBar is simply not being set at that time, because in my viewController super.viewDidLoad is called before setting the height.

jekahy avatar Feb 29 '16 22:02 jekahy