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

动态改变title值问题 #49

Closed
xiaopindev opened this issue Aug 13, 2020 · 6 comments
Closed

动态改变title值问题 #49

xiaopindev opened this issue Aug 13, 2020 · 6 comments

Comments

@xiaopindev
Copy link

代码
` let titles = ["即时","赛果","赛程","关注"]
let vc1 = vc1()
addChild(vc1)
let vc2 = vc2()
addChild(vc2)
let vc3 = vc3()
addChild(vc3)
let vc4 = vc4()
addChild(vc4)

    titleView = PageTitleView(frame: pp_frame(5,88, 375 ,30), style: style, titles: titles, currentIndex: 0)

    contentView = PageContentView(frame: pp_frame(0,88,375,500), style: style, childViewControllers: children, currentIndex: 0)

    view.addSubview(titleView!)
    view.addSubview(contentView!)

    titleView?.delegate = contentView
    contentView?.delegate = titleView`

我想要动态修改title的值:
let label = self.titleView?.titleLabels[3] label?.text = "关注(12)"

问题:关注 显示变成 “关...” , 显示不全,能动态改变值又能正常显示吗?

@Danie1s
Copy link
Owner

Danie1s commented Aug 13, 2020

抱歉,当初设计的时候没有考虑到动态修改title的值,我最近会增加这个特性,请耐心等待

@Danie1s Danie1s closed this as completed Aug 13, 2020
@Danie1s
Copy link
Owner

Danie1s commented Aug 16, 2020

@xiaopindev 已经更新

@xiaopindev
Copy link
Author

@xiaopindev 已经更新

好的, 我试试,感谢更新!

@xiaopindev
Copy link
Author

@xiaopindev 已经更新

你用的PageViewManager, 我没有用这种方式也可以吗?

@xiaopindev
Copy link
Author

@xiaopindev 已经更新

有方法可以直接用,你设置成私有的和内部访问了

@Danie1s
Copy link
Owner

Danie1s commented Aug 17, 2020

不行,为了代码更加内聚,请使用我提供的方法

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

2 participants