草庐IT

name-binding

全部标签

android - 无法使 Android 数据绑定(bind)插件工作

到目前为止,我正在尝试使用android数据绑定(bind)插件,但没有成功。我正在使用:Gradle2.2.1;IntellijIDEA15。项目级build.gradle:buildscript{repositories{jcenter()}dependencies{classpath'com.android.tools.build:gradle:1.5.0'classpath"com.android.databinding:dataBinder:1.0-rc2"//NOTE:Donotplaceyourapplicationdependencieshere;theybelong/

java - @Binds 方法必须只有一个参数,其类型可分配给返回类型

我正在迁移到新的daggerandroid2.11所有设置均基于Google蓝图:MVP-Dagger。但我遇到此错误:Error:(22,57)error:@Bindsmethodsmusthaveonlyoneparameterwhosetypeisassignabletothereturntype在这一行中:@ActivityScoped@BindsabstractPresenterFactoryprovidePresenterFactory(MainPresenterpresenter);主持人:@ActivityScopedpublicclassMainPresenterex

android - 带有参数或操作的目标必须具有 'name' 或 'id' 属性

我使用Android导航组件创建了一个全局操作,但在编译代码时出现以下错误错误:Error:Destinationwithargumentsoractionsmusthave'name'or'id'attributes. 最佳答案 要使用全局操作,您需要为导航图提供一个ID(目前它不会自动生成)。只需将“id”属性添加到您的导航元素,如下所示: 关于android-带有参数或操作的目标必须具有'name'或'id'属性,我们在StackOverflow上找到一个类似的问题:

android - 将 Activity 绑定(bind)到正在运行的服务时未调用 onUnbind

我有这个启动并绑定(bind)到服务的Activity:@OverrideprotectedvoidonStart(){super.onStart();Intentintent=newIntent(context,SoundService.class);context.startService(intent);context.bindService(intent,serviceConnection,Context.BIND_AUTO_CREATE);}然后我解除绑定(bind):@OverrideprotectedvoidonStop(){context.unbindService(s

android - Android中如何绑定(bind)React Native的图片资源?

我用react-nativebundle--entry-file"index.android.js"--platform"android"--bundle-output"./assets/index.android.bundle"--verbose将JScodebundle打包放入assets中,可以但是本map片资源无法显示,本map片资源位于./App/Img/文件夹下,并且用于:consticon1=require('./App/Img/slider.png');我怎样才能bundle这些资源文件,以便我可以生成一个运行的apk。 最佳答案

android - 将位置绑定(bind)到 MVVM 中的 MapView

只是想知道如何将纬度和经度绑定(bind)到com.google.android.gms.maps.MapView。感觉它没有公开任何布局属性。 最佳答案 我自己找到了答案。只需要创建带有@BindingAdapter注解的静态方法。像这样的东西:@BindingAdapter("app:latLong")publicstaticvoidbindLocationToMap(MapViewmapView,LatLnglatLong){CameraUpdatecameraUpdate=CameraUpdateFactory.newLat

android - 为什么使用 Binding Interface 会导致 Class Not Found 异常?

我正在尝试为任何Android创建自定义属性View.我在thispost中看到我可以用数据绑定(bind)库来做到这一点。DataBindingGuide帖子解释布局应以开头标签,但在对其充气时出现以下异常:05-0622:36:31.29411916-11916/com.plnech.exampleE/AndroidRuntime:FATALEXCEPTION:mainProcess:com.plnech.example,PID:11916android.view.InflateException:BinaryXMLfileline#1:BinaryXMLfileline#1:Er

android :background attribute using string color code 上的 android 数据绑定(bind)

我有一个颜色代码作为字符串存储在一个名为bean的数据对象中,如下所示:publicclassSpaceBeanextendsBaseObservable{privateStringselectedThemeColor;@Nullable@BindablepublicStringgetSelectedThemeColor(){returnselectedThemeColor;}publicvoidsetSelectedThemeColor(StringselectedThemeColor){this.selectedThemeColor=selectedThemeColor;notif

Android工作室错误java.lang.IllegalArgumentException : Resource name cannot be empty

我正尝试在3.0版中重新打开一个较旧的AndroidStudio项目。它编译和启动都很好,但如果我尝试在布局设计器中编辑布局,它不会加载,只是一直说它正在等待构建完成(它已经完成)。当我查看IDE错误时,我看到了这个错误:provider:org.jetbrains.android.augment.AndroidPsiAugmentProvider@2180343:Resourcenamecannotbeempty.AsIlookthoughthetraceinfo,Iseenothingthatpointsbackatmyproject.Anysuggestions?Hereisth

java - 如何绑定(bind) Activity 中 NavigationView 中的 TextView

我们正在使用androidsdk26和butterknife8.8.1HomeActivity有一个导航头,导航头还包含一些TextView。是否可以在HomeActivity中绑定(bind)TextViews?!这里有一些描述我的问题的代码HomeActivity类的布局如下nav_header中有一些TextView是否可以在HomeActivity中绑定(bind)userinfo_vo_nameTextView的id,简单的BindView失败//fails@BindView(R.id.userinfo_vo_name)TextViewuserinfoName;当然,我在on