2014-11-22 2 views
0

저는 안드로이드 프로그래밍 세계에서 새롭고 일부 레이아웃 디자인 문제에 직면 해 있습니다. 두 이미지가 포함 된 레이아웃의 패딩이있다 는 빨간색 화살표를 참조하십시오레이아웃에 원하지 않는 패딩이 있습니다.

http://www.servimg.com/view/13840630/200

당신은 내가 어이와 폭 모두에 대한 wrap_content 속성을 사용하고, 그래서 정말 안 볼 수 있듯이

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    tools:context="com.scimoon.henri.scimoon.Game" 
    android:background="@color/white" 
    android:orientation="vertical"> 

    <LinearLayout 
     android:orientation="horizontal" 
     android:paddingTop="15dp" 
     android:paddingBottom="5dp" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/darkBlue" 
     android:id="@+id/back"> 
     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" 
      android:src="@drawable/back"/> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="10dp" 
      android:text="@string/back" 
      android:textColor="@color/white" 
      android:textSize="35dp"/> 
    </LinearLayout> 


    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:layout_gravity="center_horizontal" 
     android:layout_weight="1"> 
     <ImageView 
      android:id="@+id/bt_bleu" 
      android:scaleType="fitXY" 
      android:adjustViewBounds="true" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:src="@drawable/bt_bleu" 
      android:layout_weight="1"/> 
     <ImageView 
      android:id="@+id/bt_rouge" 
      android:scaleType="fitXY" 
      android:adjustViewBounds="true" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/bt_rouge" 
      android:layout_weight="1"/> 
    </LinearLayout> 


    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:layout_gravity="center_horizontal" 
     android:layout_weight="1"> 

     <ImageView 
      android:id="@+id/bt_jaune" 
      android:scaleType="fitXY" 
      android:adjustViewBounds="true" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:src="@drawable/bt_jaune" 
      android:layout_weight="1"/> 

     <ImageView 
      android:id="@+id/bt_vert" 
      android:scaleType="fitXY" 
      android:adjustViewBounds="true" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/bt_vert" 
      android:layout_margin="0dp" 
      android:padding="0dp" 
      android:layout_weight="1"/> 

    </LinearLayout> 
</LinearLayout> 

모든 아이디어를 어떻게 없애 : 왜 이런 일

다음

내 레이아웃입니다 ... 이해? 당신의 입술 안쪽

답변

0

이 값은 내부의 그 열 dimens.xml라는 파일이 거짓말을한다라는 폴더가 있고 당신이 당신의 마진이 모두 너무 1DP 또는 0dp

+0

죄송하지만 이것이 작동하지 않습니다. 다음은 내 dimens.xml입니다. ' 0dp 0dp ' > 120dp 내가 같은 문제가 있습니다 :/ – Monstercrunch

0

모두 당신은 LinearLayouts에 android:layout_weight="1" 제거를 설정 찾을 폴더 원이 들어 있습니다.

+0

감사합니다 귀하의 제안에 대한 해결책이 있지만 가로 모드에서 다른 문제가 있습니다 : http://i59.servimg.com/u/f59/13/84/06/30/screen11.png – Monstercrunch

+0

어떤 종류의 문제입니까? – SunnySydeUp

+0

글쎄, 두 개의 첫 번째 원이 맨 아래 두 개의 원보다 더 큰 것을 볼 수 있습니다. 나는 그들 모두를 위해 같은 크기를 원한다. 그리고 만약 내가 가중치 = 1, 가로 모드에서 아무런 문제가 없다 – Monstercrunch

관련 문제