2017-08-27 9 views
2

XMLレイアウトファイルでカスタムKotlinビューを含む問題が発生しています。レイアウトでカスタムKotlinビューで「次のクラスが見つかりませんでした」

class CustomView: RelativeLayout { 

    /** 
    * Programmatic constructor 
    */ 
    constructor(aVariable: Boolean, context: Context): super(context) { ... } 

    /** 
    * XML constructor 
    */ 
    @JvmOverloads 
    constructor(context: Context, attributeSet: AttributeSet? = null, defStyle: Int = 0): super(context, attributeSet, defStyle) { ... } 

} 

XML:ここでは、コードです

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    tools:context=".MainActivity"> 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/recyclerView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

    <com.turingtechnologies.materialscrollbar.CustomView 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentEnd="true" /> 

</RelativeLayout> 

そして、レイアウトプレビューアは文句:

「次のクラスが見つかりませんでしたクラス -

がありません: com.turingtechnologies.materialscrollbar.CustomView(ビルドパスの修正、編集XMLは、)クラスの作成」

注:これは、3.0ベータ3

+0

安定版ASの動作は何ですか? –

+0

@ MaximOstrovidov私は見てあなたに知らせてください –

+0

コードはうまくいくようです。それはちょうどASによっていくつかの遅れかもしれません。 "clean - > rebuild"を試みるか、キャッシュを無効にしてください。 –

答えて

関連する問題