본문 바로가기

개발도구/aOS - 안드로이드 개발

[안드로이드] TextView 의 설정

    <TextView
        android:id="@+id/icon_text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="TextView"
        android:gravity="center"
        android:textStyle="bold" android:layout_gravity="bottom"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textSize="20px" android:background="@drawable/bg_intro_tit"
        android:lines="1" android:duplicateParentState="true"
        android:textColor="#FFFFFF">
        </TextView>

[ android:textAppearance]


textAppearance
textAppearanceButton
textAppearanceInverse
textAppearanceLarge
textAppearanceLargeInverse
textAppearanceMedium
textAppearanceMediumInverse
textAppearanceSearchResultSubtitle (API Level : 5)
textAppearanceSearchResultTitle (API Level : 5)
textAppearanceSmall
textAppearanceSmallInverse


duplicateParentState
android:duplicateParentState

When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself.

해석해 보자면 이 속성이 true로 설정이 되면 자신의 보다 부모에서 직접적으로 상태 drawable을 가져온다 라고 해석이 될듯하다. 즉 부모가 클릭이 되면 자식인 자신도 클릭이된다. 반대로 체크박스를 클릭해도 부모도 함께 클릭이 되게된다.