Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itemWidth设置为固定,且items的宽度不足占满一屏时,位置会发生变化 #2

Open
geGao123 opened this issue Dec 4, 2017 · 0 comments

Comments

@geGao123
Copy link

geGao123 commented Dec 4, 2017

如题:
image

        pageView.delegate = self
        self.addSubview(pageView)
        pageView.whc_Left(0)
            .whc_Top(0)
            .whc_Right(0)
            .whc_Bottom(0)
        
        let layoutParam = WHC_PageViewLayoutParam()
        layoutParam.itemLayoutStyle = .text_Image
        layoutParam.titles = ["样式一","样式二","样式三","样式四"]

        layoutParam.itemWidth = 80 /***如果标题很多一屏放不下需要设定每个标题的固定宽度否则可以忽略***/
        layoutParam.selectedTextColor = UIColor.red
        
        layoutParam.normalBackgorundColor = UIColor.white
        layoutParam.normalTextColor = UIColor.black
        layoutParam.bottomLineColor = .red
        layoutParam.bottomLineHeight = 1
        layoutParam.cursorColor = .red
        
        pageView.layoutIfNeeded()
        pageView.layoutParam = layoutParam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant