创建的Android TextSwitcher动态生成的TextView [英] Create Android TextSwitcher with dynamically generated Textview
问题描述
我打算建立一个画廊般的 TextSwitcher
与的TextView
像这样
I intend to create a Gallery-like TextSwitcher
with TextView
like this
请参阅图像 http://img441.imageshack.us/img441/5610/textp。 PNG
当我点击选定的TextView
,活动将陆续推出。
When i click on a selected TextView
, an activity will be launched.
我已经阅读了Android API演示和许多其他职位,我仍然不能创造这样的事。该APIdemo不显示我如何使用的TextView
与 TextSwitcher
。
I have read the Android API demo and many other posts and I still cannot create anything like this. The APIdemo does not show me how to use TextView
with TextSwitcher
.
我相信这是非常有用的<一个href="http://www.java2s.com/Open-Source/Android/android-core/platform-frameworks-base/android/widget/TextSwitcher.java.htm" rel="nofollow">http://www.java2s.com/Open-Source/Android/android-core/platform-frameworks-base/android/widget/TextSwitcher.java.htm但我不知道如何使用这一点,并链接到我的activty 的onCreate
方法,并添加在我的动态生成的TextView
。
I believe this is useful http://www.java2s.com/Open-Source/Android/android-core/platform-frameworks-base/android/widget/TextSwitcher.java.htm but I do not know how to use this and link to my activty onCreate
method and add in my dynamically generated textview
.
会有人好心地发布工作液连同XML?对不起,我是全新到Android ..真的很AP preciate一些帮助。谢谢你。
Would someone be kind enough to post a working solution together with the XML? Sorry, I am totally new to Android.. would really appreciate some help. Thanks.
推荐答案
我是不是能够创造一个TextSwitcher一个动态的TextView。相反,我的替代解决方案是使用ImageView的代替。这样一来,我可以为链接看到创建水平滚动画廊
I was not able to create a TextSwitcher with a dynamic TextView. Instead, my alternative solution was to use ImageView instead. That way, I can create a gallery with horizontal scrolling as seen in the link
这篇关于创建的Android TextSwitcher动态生成的TextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!