하나의 버튼을 클릭하여 선택 윤곽 텍스트를 오른쪽에서 왼쪽 및 왼쪽 및 오른쪽으로 이동하는 방법, 어떻게하면 가능합니까? ?Android : 하나의 버튼을 클릭하여 오른쪽에서 왼쪽 및 왼쪽 및 오른쪽으로 선택 윤곽 텍스트를 이동하는 방법
2
A
답변
0
확인이 아웃 :
<ScrollView
android:id="@+id/sc"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/mark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/btn"
android:layout_below="@+id/txt"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="Thanks Christian but I am trying to get my text to scroll downwards automatically I am able to scroll horizontally fine."
android:textSize="50dp" />
</ScrollView>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll"/>
활동 기록에서 다음은
ScrollView scrollView=(ScrollView) findViewById(R.id.sc);
Button button=(Button) findViewById(R.id.button);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
scrollView.post(new Runnable() {
public void run() {
scrollView.smoothScrollTo(0, scrollView.getBottom());
}
});
}
});
2
예
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/mywidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:lines="1"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:textColor="#ff4500"
android:text="Simple application that shows how to use marquee, with a long text" />
전화가 활동 버튼
0123에tv = (TextView) this.findViewById(R.id.tv);
tv.setSelected(true);
7
시도해보십시오.
Animation animationToLeft = new TranslateAnimation(400, -400, 0, 0);
animationToLeft.setDuration(12000);
animationToLeft.setRepeatMode(Animation.RESTART);
animationToLeft.setRepeatCount(Animation.INFINITE);
Animation animationToRight = new TranslateAnimation(-400,400, 0, 0);
animationToRight.setDuration(12000);
animationToRight.setRepeatMode(Animation.RESTART);
animationToRight.setRepeatCount(Animation.INFINITE);
TextView textViewMarqToLeft = (TextView) findViewById(R.id.textViewMarqToLeft);
TextView textViewMarqToRight = (TextView) findViewById(R.id.textViewMarqToRight);
textViewMarqToLeft.setAnimation(animationToLeft);
textViewMarqToRight.setAnimation(animationToRight);
String textLeft = "Left marquue"
String textRight = "Right marquue"
textViewMarqToLeft.setText(textLeft);
textViewMarqToRight.setText(textRight);
3
이 코드를 사용하면 100 % 작동합니다.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_toRightOf="@+id/btnbk"
android:orientation="vertical" >
<TextView
android:id="@+id/scrollTxt"
android:layout_width="210dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="8dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="Broad way Solution... www.BroadWaySolution.com"
android:textColor="#FFFFFF"
android:textSize="15dp" />
</LinearLayout>
+0
내가 원했던 것입니다. –
+0
@ S.M_Emamian 내 대답이 유용하다는 것을 알게되어 기쁩니다.이 답변에 투표하십시오. –
관련 문제
- 1. 드롭 다운 메뉴 텍스트를 왼쪽 및 오른쪽으로 선택 하시겠습니까?
- 2. 안드로이드에서 버튼을 왼쪽 또는 오른쪽으로 프로그래밍 방식으로 이동하는 방법
- 3. 쿼리에 왼쪽 및 오른쪽으로 합치기
- 4. IOS : UIViewAnimationTransitionCurlUp 오른쪽에서 왼쪽
- 5. 오른쪽에서 왼쪽 Android 애플리케이션 개발
- 6. 아랍어 및 기타 오른쪽에서 왼쪽 slugs는 괜찮습니까?
- 7. Canvas.drawText 자바에서 오른쪽에서 왼쪽
- 8. Liferay Portlet의 오른쪽에서 왼쪽
- 9. 버튼을 오른쪽으로 이동하는 방법?
- 10. 오른쪽에서 왼쪽 전자 메일
- 11. Iphone 및 오른쪽에서 왼쪽 방향 텍스트
- 12. C 기반 언어의 오른쪽에서 왼쪽 및 왼쪽에서 오른쪽으로의 연관성은 무엇입니까?
- 13. jQuery : 슬라이드 왼쪽 및 오른쪽으로 슬라이드
- 14. slideToggle 오른쪽에서 왼쪽
- 15. 오른쪽에서 왼쪽 UI 지침
- 16. PyQt : 오른쪽에서 왼쪽 컨트롤
- 17. iTextSharp XmlWorker : 오른쪽에서 왼쪽
- 18. wxWidgets 오른쪽에서 왼쪽 방향
- 19. html - menu - 오른쪽에서 왼쪽
- 20. gridview에서 오른쪽에서 왼쪽 방향 사용
- 21. android : 슬라이드보기에서 왼쪽 또는 오른쪽으로 스 와이프
- 22. Android 왼쪽 또는 오른쪽으로 스 와이프 하시겠습니까?
- 23. 레이블을 어떻게 남기려면 왼쪽 및 선택 윤곽합니까?
- 24. Android에서 TextView에 대한 오른쪽에서 왼쪽 지원
- 25. 새로운 페이지로 왼쪽/오른쪽으로 스크롤
- 26. ControlDesigner를 사용하여 왼쪽 및 오른쪽으로 도킹을 허용하는 방법
- 27. UIViewAnimationTransitionCurlUp 가로 방향 (왼쪽 및 오른쪽 모두) 방향에서 오른쪽에서 왼쪽으로
- 28. 오른쪽에서 왼쪽 툴팁 텍스트 C#
- 29. 안드로이드 캔버스 drawText 오른쪽에서 왼쪽
- 30. 설정 JLabel의 정렬 오른쪽에서 왼쪽
감사합니다 :) :) – Sourabh
안녕하세요. – Kogile