У меня есть класс, расширяющий RelativeLayout как так:Android: Расширение RelativeLayout
class CustomLayout extends RelativeLayout {
CustomLayout(Context context) {
super(context, null, 0);
}
CustomLayout(Context context, AttributeSet attrs) {
super(context, attrs, 0);
}
CustomLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
}
Я использую этот макет через файл XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.vj.myapp.CustomLayout
android:id="@+id/imageView_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#555"
android:layout_weight="1">
</com.vj.myapp.CustomLayout>
</LinearLayout>
но приложение аварий с:
Error inflating class com.vj.myapp.CustomView
Я предоставил необходимые конструкторы. Что происходит?
Кстати, как правильно форматировать код андроида в моем посте? – Alterecho
Можете ли вы опубликовать полный стек? – Floern
'Ошибка раздувания класса com.vj.myapp.CustomView', где есть CustomView? – ataulm