Custom string attribute breaks Android Studio's ConstraintLayout preview









up vote
0
down vote

favorite












I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:



broken view when setting custom attribute named model_field



attrs.xml:



<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>


Layout.xml:



<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">

<!-- TODO: Update blank fragment layout -->


<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>


When I remove the model_field attributes, the preview works properly like below



the view when I remove the custom attributes named "model_field"










share|improve this question























  • check Car_engine_no string resource
    – navylover
    2 days ago










  • @navylover it already exists like <string name="Car_engine_no">Car.engine_no</string>. The custom views with attribute model_field slides up to the top of the layout. The constraints not working with custom attribute.
    – Yusuf Gündoğdu
    2 days ago















up vote
0
down vote

favorite












I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:



broken view when setting custom attribute named model_field



attrs.xml:



<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>


Layout.xml:



<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">

<!-- TODO: Update blank fragment layout -->


<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>


When I remove the model_field attributes, the preview works properly like below



the view when I remove the custom attributes named "model_field"










share|improve this question























  • check Car_engine_no string resource
    – navylover
    2 days ago










  • @navylover it already exists like <string name="Car_engine_no">Car.engine_no</string>. The custom views with attribute model_field slides up to the top of the layout. The constraints not working with custom attribute.
    – Yusuf Gündoğdu
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:



broken view when setting custom attribute named model_field



attrs.xml:



<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>


Layout.xml:



<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">

<!-- TODO: Update blank fragment layout -->


<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>


When I remove the model_field attributes, the preview works properly like below



the view when I remove the custom attributes named "model_field"










share|improve this question















I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:



broken view when setting custom attribute named model_field



attrs.xml:



<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>


Layout.xml:



<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">

<!-- TODO: Update blank fragment layout -->


<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>


When I remove the model_field attributes, the preview works properly like below



the view when I remove the custom attributes named "model_field"







java android android-studio kotlin custom-attribute






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago

























asked 2 days ago









Yusuf Gündoğdu

11




11











  • check Car_engine_no string resource
    – navylover
    2 days ago










  • @navylover it already exists like <string name="Car_engine_no">Car.engine_no</string>. The custom views with attribute model_field slides up to the top of the layout. The constraints not working with custom attribute.
    – Yusuf Gündoğdu
    2 days ago

















  • check Car_engine_no string resource
    – navylover
    2 days ago










  • @navylover it already exists like <string name="Car_engine_no">Car.engine_no</string>. The custom views with attribute model_field slides up to the top of the layout. The constraints not working with custom attribute.
    – Yusuf Gündoğdu
    2 days ago
















check Car_engine_no string resource
– navylover
2 days ago




check Car_engine_no string resource
– navylover
2 days ago












@navylover it already exists like <string name="Car_engine_no">Car.engine_no</string>. The custom views with attribute model_field slides up to the top of the layout. The constraints not working with custom attribute.
– Yusuf Gündoğdu
2 days ago





@navylover it already exists like <string name="Car_engine_no">Car.engine_no</string>. The custom views with attribute model_field slides up to the top of the layout. The constraints not working with custom attribute.
– Yusuf Gündoğdu
2 days ago


















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237864%2fcustom-string-attribute-breaks-android-studios-constraintlayout-preview%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237864%2fcustom-string-attribute-breaks-android-studios-constraintlayout-preview%23new-answer', 'question_page');

);

Post as a guest














































































這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

Museum of Modern and Contemporary Art of Trento and Rovereto