2013-02-01 2 views
2

Marquee TextView를 사용하여 위젯을 개발했습니다. 1 Textview를 삽입 할 때 잘 작동하지만 2 Textview를 삽입하면 첫 번째 textview가 마키가됩니다. 난 내 텍스트 뷰에 요청 포커스를 사용하고 있기 때문에 은 아마 내가 다른 텍스트를 삽입 할 때 그래서이 코드2 TextView 마키가있는 Android 위젯이 작동하지 않습니다.

 <TextView 
     android:id="@+id/runText1_txtRunningText" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:duplicateParentState="true" 
     android:ellipsize="marquee" 
     android:focusable="true" 
     android:focusableInTouchMode="true" 
     android:marqueeRepeatLimit="marquee_forever" 
     android:scrollHorizontally="true" 
     android:singleLine="true" 
     android:text="1lorem ipsum dolor sit amet 2lorem ipsum dolor sit amet 3lorem ipsum dolor sit amet lorem ipsum dolor"> 
     <requestFocus android:focusable="true" android:focusableInTouchMode="true" android:duplicateParentState="true" /> 
    </TextView> 
에게 있습니다

초점을 잃게됩니다의 관점이다

이미를 automaticly 윤곽을 실행하는 사용자 정의 텍스트 뷰를 사용해보십시오 초점을 두지 않고도 위젯에서 작동하지 않습니다.

어떻게해야합니까?

+0

난 당신과 같은 문제가 발생하는 것이 도움이 될 수 있습니다 시도? – lynn8570

+0

아직, finnaly 난 1 마키 텍스트와 함께 내 위젯 인터페이스를 변경 – user1752973

+0

나는 똑같이 직면하고있다 [이 코드를 시도하십시오] (http://stackoverflow.com/a/35725649/1811356) – Hardian

답변

0

<TextView 
    android:id="@+id/mywidget" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:ellipsize="marquee" 
    android:fadingEdge="horizontal" 
    android:lines="1" 
    android:marqueeRepeatLimit="marquee_forever" 
    android:scrollHorizontally="true" 
    android:text="Simple application for marquee with example as shown" 
    android:textColor="#ff4500" /> 

<TextView 
    android:id="@+id/mywidget1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:ellipsize="marquee" 
    android:fadingEdge="horizontal" 
    android:lines="1" 
    android:marqueeRepeatLimit="marquee_forever" 
    android:scrollHorizontally="true" 
    android:text="haihaihaihaihaihaiahaiahaiahaiahaiahaiahaiahaiahaiahaiahiaha" 
    android:textColor="#ff4500" /> 

당신이 지금 알아 낸, 위의 코드는

+0

나는 이미 시도 Android 4.0 및 3.0에서는 작동하지 않습니다. – user1752973

관련 문제