Code Monkey home page Code Monkey logo

Comments (5)

angcyo avatar angcyo commented on July 30, 2024

测试代码已提交, 没有出现你说的问题.

MainFragment.kt:60

onSelectViewChange = { fromView, selectViewList, reselect, fromUser ->
    val toView = selectViewList.first()
    L.i("fromView:${fromView.hashCode()} toView:${toView.hashCode()}")
}

日志输出如下:

[(MainFragment.kt#invoke#60 (MainFragment.kt:70)#invoke:main] fromView:0 toView:81484104
[(MainFragment.kt#invoke#60 (MainFragment.kt:70)#invoke:main] fromView:81484104 toView:32555508
[(MainFragment.kt#invoke#60 (MainFragment.kt:70)#invoke:main] fromView:32555508 toView:145779602
[(MainFragment.kt#invoke#60 (MainFragment.kt:70)#invoke:main] fromView:145779602 toView:81484104
[(MainFragment.kt#invoke#60 (MainFragment.kt:70)#invoke:main] fromView:81484104 toView:32555508

from dsltablayout.

chesonsir avatar chesonsir commented on July 30, 2024

通过addView代码添加item会不会有影响

from dsltablayout.

chesonsir avatar chesonsir commented on July 30, 2024

我的item的View是两个TextView组成的,通过addView动态添加item,设置tab_enable_text_bold没有效果,通过onSelectViewChange来改变item字体粗细,但是fromView始终指向第一个item,我打印的view的id是一样的

from dsltablayout.

angcyo avatar angcyo commented on July 30, 2024

通过addView代码添加item会不会有影响

动态添加item的demo在 DynamicActivity.kt:42, 没出现问题.,

from dsltablayout.

angcyo avatar angcyo commented on July 30, 2024

我的item的View是两个TextView组成的,通过addView动态添加item,设置tab_enable_text_bold没有效果,通过onSelectViewChange来改变item字体粗细,但是fromView始终指向第一个item,我打印的view的id是一样的

重写onGetTextStyleView方法, 获取操作目标的TextView.

from dsltablayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.