我刚刚尝试为我的一个项目生成签名的apk(之前我已经这样做了),但是(也许自从更新Android Studio)我得到了
错误:错误:字符串[ResourceType]类型的预期资源
这是因为我正在使用Butterknife的@BindString,它被生成类似的东西
target.settings = res.getString(2131230792);
Run Code Online (Sandbox Code Playgroud)
如何让工作室不将此检测为错误?我试过在设置中搜索,但没有成功.
我正在查看生成的ButterKnife代码,并注意到对于@OnClick注释,它使用的是DebouncingOnClickListener由库实现的.
这是DebouncingOnClickListener为了避免在同一帧上使用该侦听器多次单击任何元素(实现此目的,它们使用静态标志).你可以在这里看到实现.
我试图找到一个解释,为什么他们决定在库管理的每个点击事件中使用它,但找不到任何.
那么,为什么他们使用它呢?为什么他们决定ButterKnife的每个用户都需要这个?不应该是决定使用它的用户?为什么要将视图绑定帮助它提供这个"功能"?如果我想在同一帧上多次点击,会发生什么?我无法使用ButterKnife进行点击活动.
我不假装冒犯,只想要一个解释,也许我错过了什么.
我是Android开发的新手,我只是想知道如何在两个TextView之间添加空间?任何帮助,将不胜感激.
我到目前为止编写的代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/lbl_group_coworkers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Coworkers" />
<TextView
android:id="@id/lbl_group_"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Family"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)