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

建议 #47

Closed
huyanminggithub opened this issue Jul 19, 2017 · 8 comments
Closed

建议 #47

huyanminggithub opened this issue Jul 19, 2017 · 8 comments

Comments

@huyanminggithub
Copy link

在OnClickListener里把当前点击的View传回来,原因:如果用代码动态设置superTextView的数量时,他的点击事件也是for循环里添加的,有些需求是点击后 回调处理的,还需要把动态创建的superTextView变成成员变量才能继续对他做设置,不是很灵活,如果把当前View 直接传回来就能解决这个问题,动态创建很正常如果我有10个或者更多的item 我不可能全部写在xml里 这样太不优雅了

@lygttpod
Copy link
Owner

你的意思是点击整个view回传SuperTextView对象,点击任意textView(例如中间的textView)返回对应的textView吗?还是说点击任意view都回传SuperTextView对象

@lygttpod
Copy link
Owner

@huyanminggithub
还有一种情况 如果item很多的话 就直接使用listviw或者recyclerview处理更方便

@huyanminggithub
Copy link
Author

恩就是传回supertextview或者点击的对应的view都行,list的用法可以,但是有时候也会结合scrollview使用,因为设计师的布局不一定是啥样,有的时候也会有直接往linnerlayout中使用,所以我觉得 可能返回对象会好一些,单纯建议 您斟酌处理,再次感谢您的开源 

@lygttpod
Copy link
Owner

@huyanminggithub 如果你要动态创建的话 意味者xml中所有属性都可以用代码实现,这是一个庞大的工程哦

@yuxingfafu
Copy link

sCenterTextString能否也对应添加一个属性类似stv:sRightViewGravity="" ,

@yuxingfafu
Copy link

sCenterTvDrawableLeft 建议有对应的属性也提供对应的代码设置的方法

@lygttpod
Copy link
Owner

lygttpod commented Aug 3, 2017

@yuxingfafu
第一个问题 现在就有三个属性 有问题请看文档 属性说明
sLeftViewGravity sCenterViewGravity sRightViewGravity

第二个问题 考虑到centerTv使用图片不多,就没加上去,如果你有这个需求 可以使用commonTextView,里边支持代码设置左、中、右TV的drawable

@lygttpod
Copy link
Owner

lygttpod commented Aug 6, 2017

@huyanminggithub
点击事件回传对象问题已经解决,请阅读说明文档,使用最新版 2.1.0

@yuxingfafu
sXXXTvDrawableXXX 均提供对应的代码设置的方法,请阅读说明文档,使用最新版 2.1.0

@lygttpod lygttpod closed this as completed Aug 6, 2017
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

3 participants