다른 스레드에서 속성 값 wrap_content를 조사하여 해당 함수가 "보기에 포함 된 값 (또는 하위 컨트롤)을 포함 할 수있을 정도로만 확장되도록해야합니다."라는 컨트롤이 있음 - 텍스트 상자 (TextView) 또는 이미지 - http://imgur.com/6H8caKT (이미지 뷰).빈 텍스트가있는 edittext에 여전히 높이가있는 이유는 무엇입니까?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Email"
android:padding="5dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
빈 글고이이 표시되는 텍스트 나 이미지를 포장 할 것이다 "(What's the difference between fill_parent and wrap_content?) Heres는 내 코드 (그리고 하나의 선택 결과의 레이아웃 (편집 텍스트입니다)
제 질문은 편집 텍스트에 아무것도 (빈 텍스트)가 없기 때문에 wrap_content는 높이가 없어야한다는 것입니다.
으로 스트레칭한다. 'EditText'에 높이가 없다면, 그렇게 할 수 없습니다. 따라서'EditText'가 최소 한 줄 높이를 적용한다고 가정합니다. – CommonsWare
요소를 숨기려면이 게시물을보십시오. http://stackoverflow.com/questions/4480489/can-you-hide-an-element-in-a-layout-such-as-a-spinner- 의존 - 따라 - 활동 –
아니 내가 그것을 숨기고 싶지 않아. 왜 그냥 wrap_content – committedandroider