TabWidget에서 추가되는 Tab의 Background변경하기 Tab마다 View를 얻어와서 직접 BackgroundDrawable을 지정하고 아래 막대부분은 reflection을 이용하여 꽁수로 바꿔치기 한다 tab_indicator.xml, tab_bar_left.xml, tab_bar_right.xml 내용은 로 정의 private void changeTabWidgetStyle(TabWidget tw){ for (int i = 0; i < tw.getChildCount(); i++) { View v = tw.getChildAt(i); v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_indicator)); } Field mBot..
http://developer.android.com/guide/tutorials/views/hello-tabwidget.html 위 링크의 TabWidget 예제로 이리저리 TabWidget의 background 변경해본 결과 먼저 background 로 쓸 drawable 파일 준비 일단 tabWidget의 background로 사용할 drawable 파일을 만들었다 물론 그냥 색상을 지정해도 상관없다 ㅋㅋ (걍 이런저런 기능 사용해보기위해) res/drawable/tab_bg.xml 이제 이 background를 적용해 보았다 1. Theme로 적용 styles.xml 만든다 여기서 tabWidgetStyle은 모두 "Widget.TabWidget" style을 사용하도록 하고 background를 ..
Android에서도 UI관련 행위는 UI Thread위에서 해야한다 그렇지 않으면 아래와 같은 Exception이 발생한다 android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created ..... Swing의 SwingUtilities.invokeLater(Runnable r)와 같은 역할을 하는 아래의 방법을 사용하여 해결할수 있다 Activity.runOnUiThread(Runnable action) View.post(Runnable action) View.postDelayed(Runnable action, long delayMillis) Handler.post(Runnable action)
- Total
- 724,015
- Today
- 0
- Yesterday
- 20
- android
- 일어일기
- 락
- 서울숲별밤축제
- 드라마
- 일기
- 포스트크로싱
- 음악
- 신주쿠
- 책
- 여행
- 안드로이드
- 에픽하이
- 일본
- 도쿄
- Java
- 잡담
- 노래
- 진해
- 야마다 타카유키
- 영화
- 코이데 케이스케
- postcrossing
- epik high
- 공연
- Linux
- 사진
- 인디
- Mac
- 아사가야