BLOG ARTICLE Program/Android | 22 ARTICLE FOUND

  1. 2010.10.12 이미지 버튼 선택에 따른 이미지 바꾸기 예제
  2. 2010.09.08 Title style 변경


<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:color="hex  color" android:color= hex_color
android:state_pressed=["true" | "false"]
android:state_focused=["true" | "false"]
android:state_selected=["true" | "false"]
android:state  active=["true" | "false"]
android:state_checkable=["true" | "false"]
android:state_checked=["true" | "false"]
android:state_enabled=["true" | "false"]
android:state_window_focused=["true" | "false"]
 />
</selector>

selector_btn.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">  
 <item android:state_pressed="true" android:drawable="@drawable/btn_legend_f"></item>
 <item android:state_focused="true" android:drawable="@drawable/btn_legend_f" ></item>
 <item android:drawable="@drawable/btn_legend"></item>
</selector>


<ImageButton   android:id = "@+id/VideoButton"
     android:layout_width = "wrap_content"
     android:layout_height = "wrap_content"
     android:src ="@drawable/selector_btn"
    /> 
AND


<style name="CustomWindowTitleText" parent="android:TextAppearance.WindowTitle">
          <item name="android:textSize">20dip</item>
          <item name="android:textColor">#ffffff</item>
          <item name="android:textStyle">bold</item>        
</style>
  
     <!-- Set the theme for the window title -->
     <!-- NOTE: setting android:textAppearence to style defined above -->
     <style name="CustomWindowTitle" parent="android:WindowTitle">
          <item name="android:textAppearance">@style/CustomWindowTitleText</item>
     <!--       <item name="android:gravity">center</item>
      <item name="android:shadowDx">0</item>
          <item name="android:shadowDy">0</item>
          <item name="android:shadowRadius">5</item>
          <item name="android:shadowColor">#1155CC</item>  -->
    </style>

   <style name="TitleTheme" parent="android:Theme">
           <item name="android:windowTitleSize">40dip</item>
           <item name="android:windowTitleStyle">@style/CustomWindowTitle</item>
           
         <!--   <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>  -->
      </style>

빨간색 보면 타이틀바의 높이도 커진다. 근데 텍스트의 위치가 변하지 않아서 그냥 TextView를 써야 겠당.

AND