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

imageView, button에서 background 입력시 사이즈 커지는 현상

0 추천

imageView와 button의 사이즈를

가로 세로 (65dp, 65dp)와 (35dp, 25dp)로 정의해서 사용중입니다.

꼭 사이즈를 작게 해야 되서 저렇게 했지만,

 

이 뷰들에 background를 적용하면 사이즈가 커져버립니다...

분명히 크기는 절대적인 dp값을 줬는데.. 왜 커지는 것일까요

 

<!-- 3개의 버튼(사진)이 들어갈 레이아웃 -->
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:orientation="horizontal"
    android:layout_weight="0.7">
    <!-- 첫번째 + 버튼 -->
    <RelativeLayout
        android:layout_width="65dp"
        android:layout_height="match_parent">
        <Button
            android:id="@+id/btn_report_addImage1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
        <RelativeLayout
            android:id="@+id/layout_report_image1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone" >

            <ImageView
                android:id="@+id/image_report_image1"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </RelativeLayout>
    </RelativeLayout>

    <!-- 두번째 + 버튼 -->
    <RelativeLayout
        android:layout_width="65dp"
        android:layout_height="match_parent"
        android:layout_marginLeft="5dp">
        <Button
            android:id="@+id/btn_report_addImage2"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
        <RelativeLayout
            android:id="@+id/layout_report_image2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone">

            <ImageView
                android:id="@+id/image_report_image2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="fitXY"/>
        </RelativeLayout>
    </RelativeLayout>
익명사용자 님이 2017년 1월 16일 질문
2017년 1월 16일 수정

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...