Android开源控件搜集--Text View

本文精选了一系列Android平台上的TextView开源控件,包括可跳动显示字符的Ticker、可折叠展示的ExpandableTextView等,旨在为开发者提供更多选择和灵感。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Android开源控件搜集—-Text View

Note:本篇博客长期维护更新,欢迎各位网友共同合作,共享知识与技术。

本篇博客主要搜集个人任务比较优秀的Android开源控件,大多来自github,并附上链接,自己学习之余,亦希望于大家有所帮助。

Android的控件还算比较多,官方和第三方自定义优秀控件数不胜数,搜集难免不全,逐步更新丰富吧。

Text View

其实好多第三方view,都是自定义的,未必十分符合text View的概念,姑且把个人认为的text view归类到此吧。

  1. Ticker

    简单的可实现跳动显示字符的Text View,效果:

    ticker

    github地址:https://github.com/robinhood/ticker

  2. Expandable Text View

    正如项目介绍一样,这是一个可以折叠/展开的Text View,效果:

    expandable

    github地址:https://github.com/Manabu-GT/ExpandableTextView

  3. SlantedTextView

    倾斜的Text View,多用于给图片加个小标签,效果:

    slanted

    github地址:https://github.com/HeZaiJin/SlantedTextView

  4. ReadMoreTextView

    类似上面expandable TextView 这也是一个可以折叠/站看的text View控件,效果:

    ReadMore

    github地址:https://github.com/borjabravo10/ReadMoreTextView

  5. SuperTextView

    国人开发者写的一个自定义综合控件,常作于设置列表的item项比较合适,似乎有点实用性,效果:

    SuperTextView

    github地址:https://github.com/lygttpod/SuperTextView

  6. AutoLinkTextView

    附带可以设置链接功能的text View,效果:

    autolink

    github地址:https://github.com/armcha/AutoLinkTextView

  7. Floating Text

    一个可以弹出飞出文字的textview,效果:

    floating

    github地址:https://github.com/UFreedom/FloatingText

  8. SecretTextView

    具有淡入淡出效果的Text View,效果:

    Secret

    github地址:https://github.com/matthewrkula/SecretTextView

  9. DraweeTextView

    没理解作者的描述,似乎是一个可以构造复杂图形文字显示的Text View,似乎有用?效果:

    drawee

    github地址:https://github.com/Bilibili/drawee-text-view

  10. HTextView

    支持炫酷动画效果的Text View,效果:

    htextview

    github地址:https://github.com/hanks-zyh/HTextView

  11. Titanic

    这名字看不出是text view啊,呵呵,实现自动沉水的text view,效果:

    titanic

    github地址:https://github.com/RomainPiel/Titanic

  12. Shimmer

    比较流行的一个闪动式text View,效果:

    shimmer

    github地址:https://github.com/RomainPiel/Shimmer-android

    还有一个同名的,可能更强的,效果:

    shimmer

    github地址:https://github.com/facebook/shimmer-android

  13. emojicon

    一个可以显示emoji表情的textview ,效果:

    emoji

    github地址:https://github.com/rockerhieu/emojicon

  14. AutoFitTextView

    可以在限定的大小,自动调整文字大小来适应边界,效果:

    autofit

    github地址:https://github.com/grantland/android-autofittextview

  15. iconify

    可以显示很卡哇伊的效果的text view,效果:

    iconify

    github地址:https://github.com/JoanZapata/android-iconify

  16. Calligraphy

    便于快速在xml中使用字体的textview,效果:

    calligraphy

    github地址:https://github.com/chrisjenx/Calligraphy

  17. RobotoText View

    类似上边,这个可以快捷使用android的roboto字体的textview,效果:

    roboto

    github地址:https://github.com/johnkil/Android-RobotoTextView

  18. JumpingBeans

    可以简单上下跳动的textview,效果:

    jumping

    jumping

    github地址:https://github.com/frakbot/JumpingBeans

  19. CountDown View

    不知算不算text view,属于一个倒计时显示的text view吧,效果:

    countdown

    github地址:https://github.com/iwgang/CountdownView

  20. VerTextView

    竖排显示的text view,效果:

    verText

    github地址:https://github.com/lfkdsk/JustWeTools

  21. LabelView

    类似上面提到的SlantedTextView,这也是一个倾斜的作为标签的textview,效果:

    label

    github地址:https://github.com/linger1216/labelview

  22. Live emoji

    可以显示动态emoji的text view,姑且成为text view吧,呵呵,效果:

    live

    github地址:https://github.com/RomainPiel/live-emoji

  23. MatchView

    随风飘散的效果的text view,效果:

    match

    github地址:https://github.com/Rogero0o/MatchView

  24. TextJustify

    算是一个可以对其调整的text view么,效果:

    justify

    github地址:https://github.com/bluejamesbond/TextJustify-Android

  25. RoundedLetterView

    类似Android联系人目录,显示头像或名字字母的text View,效果:

    rounded

    github地址:https://github.com/pavlospt/RoundedLetterView

  26. TextDrawable

    类似上面RoundedLetterView,效果:

    text

    github 地址:https://github.com/amulyakhare/TextDrawable

  27. BabushkaText

    可以自定义样式的textview,效果:

    babushka

    github地址:https://github.com/quiqueqs/BabushkaText

  28. TextSurface

    可以自带动画效果的textview,效果:

    text

    github 地址:https://github.com/elevenetc/TextSurface

  29. Text Counter

    可以上下计数的text view,效果:

    counter

    github地址:https://github.com/premnirmal/TextCounter

  30. android-ago

    可以自动更新显示其生成时间的一个text view,效果:

    text

    github地址:https://github.com/curioustechizen/android-ago

  31. TimelyTextView

    数字间变化的的一个text view,效果似乎是:

    text

    github:https://github.com/adnan-SM/TimelyTextView

### Android UI 控件实验教程 #### TextView 的基本使用 为了创建并操作 `TextView`,可以在 XML 布局文件中定义其属性,并通过 Java 或 Kotlin 代码与其交互。 ```xml <TextView android:id="@+id/my_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" /> ``` 在 Activity 中可以这样获取这个 `TextView` 并修改它的文本: ```java // 获取控件实例 TextView textView = findViewById(R.id.my_text_view); textView.setText("New Text"); ``` 此部分展示了如何利用 `android:id` 属性作为 `TextView` 的唯一标识符,在 Java 代码里可通过 `findViewById()` 方法依据 Id 来取得控件对象[^1]。 #### 使用自定义控件 当项目需求超出标准组件的功能范围时,开发者可以选择引入自定义视图。下面是一个简单的例子展示怎样声明一个名为 `TitleLayout` 的自定义控件于布局文件之中: ```xml <com.example.uicustomviews.TitleLayout android:layout_width="match_parent" android:layout_height="wrap_content"/> ``` 这段代码片段说明了如果要在应用中加入自制或者第三方库提供的特殊部件,则需按照上述方式指定完整的类路径以及必要的尺寸参数[^2]。 #### 应用样式与主题定制进度条外观 对于希望改善用户体验的应用来说,调整内置小部件的样子是非常重要的一步。这里提供了一个关于设置 RatingBar 进度指示器样式的案例: ```xml <RatingBar ... android:progressDrawable="@drawable/diy_ratingbar" /> ``` 此处演示的是通过设定 `android:progressDrawable` 属性指向一个预先准备好的 drawable 资源文件来改变默认视觉效果的方法[^4]。 #### 参考更多资源 除了官方文档外,GitHub 上也有许多优秀的开源项目可供参考学习,比如 [opendigg/awesome-github-android-ui](https://github.com/opendigg/awesome-github-android-ui),它收集了一系列高质量的 Android 用户界面设计模式和技术实现方案[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值