小编Nis*_*ara的帖子

pre v23设备上的Android TextView DrawableTint

我们有什么方法可以在Drawable使用中着色TextView吗?DrawableTint仅适用于API级别23及更高级别.

目前我正在使用a Vertical Linear Layout来达到我的要求.

<LinearLayout style="@style/ChoiceIllustratorIconTextContainerStyle">

  <ImageView
    style="@style/ChoiceIllustratorImageStyle"
    android:contentDescription="@string/cd_university"
    android:src="@drawable/ic_account_balance_white_24dp" />

  <TextView
    style="@style/ChoiceIllustratorTextStyle"
    android:text="@string/ci_text_university" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

它看起来像,在此输入图像描述

Android工作室建议我使用Compound DrawbleTextView来实现这一目标.而且我能够实现它,但我找不到Tint可绘制的方法.

<TextView
   style="@style/ChoiceIllustratorTextStyle"
   android:drawablePadding="4dp"
   android:drawableTop="@drawable/ic_account_balance_white_24dp"
   android:text="@string/ci_text_university" />
Run Code Online (Sandbox Code Playgroud)

android textview xml-drawable

9
推荐指数
4
解决办法
7715
查看次数

正则表达式,匹配模式'1AA11AA111'

我刚刚学习了RegEx的基础知识,并提出了以下正则表达式

"^\\d[a-zA-Z]{2}\\d{2}[a-zA-Z]{2}\\d{3}$"
Run Code Online (Sandbox Code Playgroud)

匹配指定的模式.它工作绝对精细.我的问题是,实现同样的其他替代方法是什么?

regex

0
推荐指数
1
解决办法
97
查看次数

是否可以在Firebase托管上托管express和socket.io应用程序?

我已经关注Firebase云功能已有一段时间了。最近,我在Firebase Hosting上遇到了托管Node.js应用程序的问题,但它只是使用express。

我们可以在Firebase上托管socket.io应用程序吗?

node.js socket.io firebase firebase-hosting

0
推荐指数
1
解决办法
1680
查看次数