2012-04-16 5 views
0

(가로로 스크롤 할 때 다른 내용을 맨 위에 놓을 목적으로) 내 TextView에서 세로 스크롤을 사용하도록 설정했는데 세로 스크롤은 텍스트가있을 때만 작동합니다. TextView의 데이터 링크. URL/이메일/etc가 없으면 세로 스크롤이 작동하지 않습니다.링크가없는 한 TextView가 수직으로 스크롤되지 않습니다.

세로 스크롤 막대는 잘못된 스크롤 위치를보고합니다.보기에서 100 % 스크롤 한 경우 화면의 최대 5 %로 이동합니다.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/LinearLayout1" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

<TextView 
    android:id="@+id/newsreader_subjectdate" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:ellipsize="marquee" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:marqueeRepeatLimit="1" 
    android:scrollHorizontally="true" 
    android:text="" 
    android:textAppearance="?android:attr/textAppearanceSmall" /> 

<TextView 
    android:id="@+id/newsreader_fromto" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:ellipsize="marquee" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:marqueeRepeatLimit="1" 
    android:scrollHorizontally="true" 
    android:text="" 
    android:textAppearance="?android:attr/textAppearanceSmall" /> 

<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <TextView 
     android:id="@+id/newsreader_message" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:autoLink="web|email" 
     android:contentDescription="News post content" 
     android:keepScreenOn="true" 
     android:paddingRight="10dp" 
     android:paddingTop="6dp" 
     android:scrollHorizontally="true" 
     android:scrollbars="horizontal|vertical" 
     android:text="" 
     android:textSize="11.5sp" 
     android:typeface="monospace" /> 
</ScrollView> 

를 추가 세부 사항으로 :

다음은이 이상한 행동을주는 문제가되는 문제 XML 레이아웃, 그리고 newsreader_message 내가 제대로 스크롤 할 수 있도록하고 싶습니다 하나입니다 , 수직 스크롤링이 깨지면 (또한 선택 문자를 스크롤해야하는 경우) 스크롤 문자가 스크롤되지 않습니다. 텍스트 뷰의

답변

0

변경 layout_width "fill_parent"한 번 시도에

+0

나는 @ + id/newsreader_message와 @ + id/scrollView1의 layout_width를 변경하려고 시도했지만 도움이되지 않았다. – Vadi

+0

한 번 layout_width = "yourscreenresloution + 50"으로 설정하고 layout_width = "500dp"라고 말하면 –

+1

시도하고 싶지 않습니다. 화면 해상도가 바뀔 수 있습니다 ... 적절한 해결책처럼 보이지 않습니다. – Vadi

0

.Another 옵션을 wrap_content되어야하는 ScrollViews 레이아웃은 스크롤을 수행있는 ScrollView를 만들기 위해 아래로 공간을 채우기 텍스트 뷰 것

<ScrollView  android:id="@+id/scrollView1"  
android:layout_width="wrap_content"  
android:layout_height="wrap_content" 
android:scrollHorizontally="true"   
android:scrollbars="horizontal|vertical" 
android:fillViewport="true" >  
    <TextView   
android:id="@+id/newsreader_message"   
android:layout_width=""fill_parent"   
android:layout_height="fill_parent"   
android:autoLink="web|email"   
android:contentDesciption="News post content"   
android:keepScreenOn="true"   
android:paddingRight="10dp"   
android:paddingTop="6dp"     
    android:text=""   
android:textSize="11.5sp"   
android:typeface="monospace" 
android:layout_weight="1.0" /> 
</ScrollView> 
+0

레이아웃이 작동하지 않을까 걱정됩니다. TextView가 가로로 스크롤되는 대신 내용을 감쌀 수있게되었습니다. 콘텐츠는 이미 미리 포장되어 있으므로 안드로이드 포장은보기에 좋지 않습니다. 안드로이드 : singleLine을 사용하여 랩하지 않도록 시도했지만, 모두 한 줄로 만듭니다! – Vadi

+0

fillViewport = "true"를 입력 했습니까? 스크롤 뷰를 채울 것입니다 –

+0

그래, XML을 그대로 복사하고 layout_width에서 트리플 인용 부호를 수정했습니다. fillViewport가 켜져 있습니다. – Vadi

관련 문제