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

화면이 갱신되지 않습니다

0 추천

현재 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>

 

111111111111111 (120 포인트) 님이 2017년 9월 22일 질문
111111111111111님이 2020년 8월 10일 reopened

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...