2016-10-18 8 views
1

이 실제로 설정, 그래서 나는, 스타일 layout_width와 layout_height 정의하지만 IDE 내 스타일을보고 안드로이드와 내 코드를 자동으로 완성 해달라고하지 않고 : layout_height = "0dp" 안드로이드 : layout_width = layout_height = "0dp" 안드로이드 : 내가 텍스트 뷰에 안드로이드를 추가 구축하거나 디자인/텍스트 IDE 사이를 전환 할 때 는 "0dp"ConstraintLayout가 자동으로 추가 layout_width/layout_height 뷰에 그것을

코드 예제 layout_width = "0dp"

<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="wrap_content"> 

<ImageView 
    android:id="@+id/iv_contact_phone" 
    android:layout_width="20dp" 
    android:layout_height="20dp" 
    android:layout_marginTop="15dp" 
    android:src="@drawable/ic_phone" 
    app:layout_constraintLeft_toLeftOf="parent" 
    app:layout_constraintTop_toTopOf="parent" /> 


<TextView 
    android:id="@+id/tv_contact_phone" 
    style="@style/FormValue" 
    android:layout_marginStart="16dp" 
    android:layout_marginTop="16dp" 
    app:layout_constraintLeft_toRightOf="@+id/iv_contact_phone" 
    app:layout_constraintTop_toTopOf="parent" /></android.support.constraint.ConstraintLayout> 

가 깜빡 나를 형식 :

compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9' 
Androd Studio 2.2.1 

답변

0

이것은 버그처럼 들리지만 code.google.com에 파일을 제출 하시겠습니까? 감사!

+0

희망이 맞았습니다. https://code.google.com/p/android/issues/detail?id=225562&thanks=225562&ts=1476866784 – Nokuap

+0

위대한! 고맙습니다 –

0

나는 내보기에서 visible = "gone"이 추가 되었기 때문에 android : layout_height = "0dp"가 추가 된 것을 발견하여이를 제거하고 Visible을 프로그래밍 방식으로 작동하도록 설정하고 당신!