【问题标题】:autoLink not working自动链接不起作用
【发布时间】:2016-05-19 16:41:43
【问题描述】:
 <TextView
        android:id="@+id/phone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:layout_below="@+id/topic"
        android:textStyle="normal"
        android:textColor="#150a18"
        android:text="  +9177xxxxxx99"
        android:autoLink="phone"
        android:gravity="center"
        android:drawableLeft="@drawable/ic_phone_black_24dp"
        android:drawableStart="@drawable/ic_phone_black_24dp"

        />

autoLink 不工作。当我点击 textview 时没有任何反应。

任何建议。

【问题讨论】:

    标签: android xml autolink


    【解决方案1】:

    您的号码最多应为 10 位数。 看看下面的链接: Android:autoLink not working fully on my 4.4 device

    【讨论】:

      【解决方案2】:

      由于某种原因,它无法正常工作。所以,也添加下面的代码,

      TextView t2 = (TextView) findViewById(R.id.text); t2.setMovementMethod(LinkMovementMethod.getInstance());

      【讨论】:

        【解决方案3】:

        你需要在资源区创建一个字符串。

        支持:click here

        也许这会有所帮助

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2014-12-24
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-01-14
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多