Kotlin-Not enough information to infer parameter T in fun<T:View> findViewById(id: Int): T!
2017-10-13 17:41
676 查看
错误:
Type inference failed : Not enough information to infer parameter T in fun<T:View> findViewById(id: Int): T! Please specify it explicitly.
解决:
holder.btnInstall = convertView.findViewById(R.id.btn_install) as Button
改为
holder.btnInstall = convertView.findViewById<Button>(R.id.btn_install)
Type inference failed : Not enough information to infer parameter T in fun<T:View> findViewById(id: Int): T! Please specify it explicitly.
解决:
holder.btnInstall = convertView.findViewById(R.id.btn_install) as Button
改为
holder.btnInstall = convertView.findViewById<Button>(R.id.btn_install)
相关文章推荐
- kotlin findviewbyid报错: type inference failed: Not enough information to infer parameter T in...
- Sending 'ViewController' to Parameter of Incompatible Type 'id<xxxDelegate>'
- 7、利用泛型和反射,让public static <T> T findById(Class<T> clazz, int id)方法,更具一般性
- Attempt to present <TestViewController2: 0x7fd7f8d10f30> on <ViewController: 0x7fd7f8c054c0> whose view is not in the window hierarchy!
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- iOS - 报错 Warning: Attempt to present <xx: xx> on <xx: xx> whose view is not in the window hierarchy!
- 初探JDeveloper - <ImageViewRendererUtils> <renderXML> Could not export XML to ResponseWriter解决方案
- findViewById() returns null for custom component in layout XML, not for other components
- dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst 的解决方法
- 通过安卓中<include>标签findViewById时出现的bug及解决方案
- Could not connect to server <servername> for application ‘SharedServices’ event ID: 6482
- Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find
- 解决“could not find gem 'turn <>=0 ' in any of the gem sources listed in your gemfile”错误
- Android中出现Error:In <declare-styleable> FontFamilyFont, unable to find attribute android:font 解决办法
- 解决:Did not expect server HTML to contain the text node " " in <div>.
- Android 开发过程中遇到了一个问题 小记录一下 ERROR: In <declare-styleable> BorderLinearLayout, unable to find attribu
- ERROR: In <declare-styleable> MenuView, unable to find attribute android:preserveIconSpacing
- Android In <declare-styleable> MenuView, unable to find attribute android:preserveIconSpacing
- ERROR: In <declare-styleable> MenuView, unable to find attribute android:preserveIconSpacing