E. *_*uku 9 android textview android-recyclerview
我有一些一般的编程知识,但我是android开发的新手,我已经开始使用RecyclerView,我也使用cardview过.但在某些情况下,标题太长了,我只想添加一个渐弱的边缘.
我在这里搜索过,但找不到任何东西.所以我自己尝试了,但是我无法让它发挥作用.我也在外面使用它RecyclerView,但结果仍然相同.
我正在使用的代码.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Hello World"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="25sp"
android:textStyle="bold"
android:fadingEdge="horizontal" <!-- I think those 2 lines should do it,
android:fadingEdgeLength="40dp"/>
Run Code Online (Sandbox Code Playgroud)
我想在Play Store的这张图片中制作淡出的TextView:

任何帮助,将不胜感激.提前致谢...
gus*_*s27 21
根据https://developer.android.com/reference/android/R.attr.html#fadingEdge android:fadingEdge已弃用.
它应该与:requiresFadingEdge="horizontal"和android:ellipsize="none":
android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="40dp"
android:ellipsize="none"
Run Code Online (Sandbox Code Playgroud)
我建议使用类似的东西,android:layout_width="match_parent"或者android:layout_width="100dp"如果你喜欢文字褪色.
| 归档时间: |
|
| 查看次数: |
10137 次 |
| 最近记录: |