마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

layout여백 문의 입니다.

0 추천

weightsum을 통해서

 

이미지 버튼 사이와 양끝에 여백을 textview 생성했는데

textview 생성이 되지 않네요..

아래의 소스와

사진에 보시면 위에처럼 하고 싶은데 아래 소스는 밑에 처럼 되네요.

해결방법이 있나요? 

제가 아니면 착각한 부분이 있나요?

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="150"
    android:weightSum="1080">
  <TextView
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_weight="56"/>


  <ImageButton
      android:id="@+id/bt_button"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="center"
      android:background="@drawable/bt"
      android:layout_weight="434"/>

  <TextView
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_weight="100"/>

  <ImageButton
      android:id="@+id/btdis_button"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="center"
      android:background="@drawable/btdisconnect"
      android:layout_weight="434"/>

  <TextView
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_weight="56"/>
</LinearLayout>
쿠쿠부다스 (6,470 포인트) 님이 2017년 2월 14일 질문

1개의 답변

0 추천
 
채택된 답변
weight 로 크기를 조절하시려면 사이즈를 0dp 로 주셔야지요.

wrap_content 로 하면 안되요~
부르스리 (1,620 포인트) 님이 2017년 2월 15일 답변
쿠쿠부다스님이 2017년 2월 15일 채택됨
...