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

layout 투명하게 만들기 질문입니다.

0 추천

안녕하세요. 

현재 layout에서 TextView의 자리(id가 name)를 Main Content에 표시되는 항목이 보이도록 투명하게 주고 싶은데요..

TextView의 background 값을 줘야 할 것 같은데, 방법이 있을까요?

 

<RelativeLayout 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"
    tools:context=".MainActivity" >

    <com.sothree.slidinguppanel.SlidingUpPanelLayout
        xmlns:sothree="http://schemas.android.com/apk/res-auto"
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="top"
        sothree:umanoPanelHeight="68dp"
        sothree:umanoShadowHeight="4dp"
        sothree:umanoParalaxOffset="100dp"
        sothree:umanoDragView="@+id/dragView"
        sothree:umanoOverlay="true">

        <!-- MAIN CONTENT -->
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            <TextView
                android:id="@+id/main"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginBottom="?attr/actionBarSize"
                android:gravity="center"
                android:text="Main Content"
                android:clickable="true"
                android:focusable="false"
                android:focusableInTouchMode="true"
                android:textSize="16sp" />

            <android.support.v7.widget.Toolbar
                xmlns:sothree="http://schemas.android.com/apk/res-auto"
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/main_toolbar"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                android:layout_width="match_parent"
                sothree:theme="@style/ActionBar"
                android:layout_alignParentBottom="true"/>

            </RelativeLayout>

        </FrameLayout>

        <!-- SLIDING LAYOUT -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:clickable="true"
            android:focusable="false"
            android:id="@+id/dragView">

            <ListView
                android:id="@+id/listview"
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:background="#000"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="68dp"
                android:orientation="horizontal"
                android:background="@drawable/layout_drawer">

                <TextView
                    android:id="@+id/name"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:textSize="14sp"
                    android:gravity="center_vertical"
                    android:paddingLeft="10dp"
                    />

                <ImageButton
                    android:id="@+id/follow"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:textSize="14sp"
                    android:paddingRight="10dp"
                    android:paddingLeft="10dp"
                    android:src="@drawable/ic_drawer"
                    android:background="@android:color/transparent"
                    android:gravity="center_vertical|right"/>



            </LinearLayout>
        </LinearLayout>
    </com.sothree.slidinguppanel.SlidingUpPanelLayout>

</RelativeLayout>

 

taejun (7,240 포인트) 님이 2015년 5월 6일 질문

1개의 답변

+1 추천
 
채택된 답변
android:background="@android:color/transparent"

텍스트뷰에 위 옵션 추가하세요

Gradler (109,780 포인트) 님이 2015년 5월 6일 답변
taejun님이 2015년 5월 6일 채택됨
listview의 색이 textview에 반영되는데
main content가 반영될 순 없을까요?
LinearLayout background을 삭제했더니 되네요 ㅎㅎ 감사해요
...