我有复杂的 XML 文件。这是一块:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:hint="@string/tel"
style="@style/AppTheme.TextInputLayout"
android:layout_marginBottom="@dimen/space_high">
<android.support.design.widget.TextInputEditText
android:id="@+id/point.j_tel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/AppTheme.TextInputEditText"/>
</android.support.design.widget.TextInputLayout>
<ImageButton
android:layout_gravity="center"
android:id="@+id/point.telEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tab_icon_edit"/>
</LinearLayout>
我正在尝试使 android:id="@+id/point.j_tel" 内的电话号码可点击。我试过了android:autoLink="all"
,,,android:autolink="phone"
。android:linksClickable="true"
但这只是导致电话号码变得有下划线和半透明但不可点击。我也在我的 Java 代码中尝试了这个:
cameraManager = new CameraManager(this);
etNotice = findViewById(R.id.point_c_notice);
getValidations().add(new TextEmptyValidation(this, etNotice));
etNotice.addTextChangedListener(getLastValidation());
tiAddress = findViewById(R.id.point_c_address);
tiTel = findViewById(R.id.point_j_tel);
tiTel.setAutoLinkMask(Linkify.PHONE_NUMBERS);
tiTel.setMovementMethod(new ScrollingMovementMethod());
这两天我尝试了很多东西,但没有任何帮助,我几乎放弃了。也许有人有任何想法?