현재 ViewPaper을 통해 탭형식으로 화면들을 만들었고
그중 한화면 내에 TabHost와 컨텐츠를 넣었는데요.
탭을 눌러서 활성화 시키면 탭버튼 이미지가 바뀌는데 키보드가 열려있을땐 이미지가 바뀌는듯하나
키보드가 내려간 뒤에는 화면이 갱신되지 않습니다.
혹은 화면을 껏다 키면 갱신되어있구요.
즉 평소에 버튼이미지가 갱신되질 않네요..
해당 질문에 대한 영상입니다.
http://cloud.atblog.co.kr:5000/sharing/oK5EaLblt
http://cloud.atblog.co.kr:5000/sharing/Ud8sNB9fq
자바소스
// set tab button, content
View novel = LayoutInflater.from(getContext()).inflate(R.layout.component_view_search_tab_novel_button, null);
View member = LayoutInflater.from(getContext()).inflate(R.layout.component_view_search_tab_member_button, null);
TextView txtNovel = (TextView)novel.findViewById(R.id.txt_title);
txtNovel.setText(R.string.novel);
TextView txtMember = (TextView)member.findViewById(R.id.txt_title);
txtMember.setText(R.string.member);
mTab.addTab(mTab.newTabSpec("TAB1").setIndicator(novel)..setContent(R.id.tab1));
mTab.addTab(mTab.newTabSpec("TAB2").setIndicator(member).setContent(R.id.tab2));
R.layout.component_view_search_tab_member_button.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tabsLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@drawable/selector_view_search_tab_left"
app:srcCompat="@drawable/search_tab_active_left" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_view_search_tab_middle"
android:scaleType="fitXY"
app:srcCompat="@drawable/search_tab_active_middle" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@drawable/selector_view_search_tab_right"
app:srcCompat="@drawable/search_tab_active_right" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="11dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/linearLayout2"
android:background="@drawable/selector_view_search_tab_member_icon"
app:srcCompat="@drawable/icon_search_tab_active_member" />
<TextView
android:id="@+id/txt_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@android:color/transparent"
android:ems="10"
android:gravity="center"
android:inputType="none"
android:text="Name"
android:textColor="#423b64"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
selector_view_search_tab_left.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="false" android:state_pressed="false" android:state_selected="true" android:drawable="@drawable/search_tab_active_left" />
<item android:state_focused="false" android:state_pressed="false" android:state_selected="false" android:drawable="@android:color/transparent" />
<item android:state_pressed="true" android:drawable="@drawable/search_tab_active_left" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/search_tab_active_left" />
</selector>