스크롤 ScrollView 내부의 모든 것. 부드럽게 스크롤하고 싶습니다.는 부드러운 I는 다음과 같이 정의 된 텍스트 뷰를 가지고 텍스트 뷰
ScrollView 안에 TextView (스크롤이 비활성화 된 상태)를 넣으려고했지만 텍스트가 포함 된 TableRow의 높이가 엉망이었습니다.이를 수정하는 방법이없는 것 같습니다.
스크롤 ScrollView 내부의 모든 것. 부드럽게 스크롤하고 싶습니다.는 부드러운 I는 다음과 같이 정의 된 텍스트 뷰를 가지고 텍스트 뷰
ScrollView 안에 TextView (스크롤이 비활성화 된 상태)를 넣으려고했지만 텍스트가 포함 된 TableRow의 높이가 엉망이었습니다.이를 수정하는 방법이없는 것 같습니다.
아마도 포커스 속성이 누락되어 Textview에 포커스가 없으므로 스크롤되지 않습니다.
<TextView
android:id="@+id/title_itemcount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:focusableInTouchMode="true"
android:maxLines="3"
android:padding="4dp"
android:scrollbars="vertical"
android:textColor="@android:color/background_dark" />
은 당신이 ScrollView
에 TextView
을 배치해야한다 "부드러운 스크롤"을 원하는 경우 :
문제는 ... 희망이 도움이. 그리고 그렇게하면 더 이상 의 TextView
높이를 "match_parent"로 설정할 수 없습니다. 예를 들어, 텍스트로 동적으로 채워지는 큰 TextBox가 필요한 경우, 과 같이 크기가 조절되지는 않습니다. 그리고 ScrollView
의 속성을 "match_parent"로 설정하면 자식 TextView
이 콘텐츠를 계속 둘러 쌉니다.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:drawable/edit_text">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="bottom"
android:singleLine="false"
android:typeface="serif"/>
</ScrollView>
</RelativeLayout>
원하는 배경으로, 새로운 TextView
로 역할을하는 RelativeLayout
용기, null로 설정 배경 원래 TextView
. TextView 이 확장되어 새로운 텍스트가 추가되면 텍스트 볼륨이 증가하는 것과 같습니다. ScrollView
인 경우 텍스트가 레이아웃 속성과 정렬됩니다.
특정 시나리오에서 ScrollView
의 스크롤과의 충돌을 피하려면 TextView
의 스크롤을 사용 중지해야 할 수도 있습니다.
포커스 특성 도움 안됨 :( – MilapTank