2010-06-02 13 views
7

मैं क्षैतिज स्क्रॉलिंग के साथ एक साधारण टेक्स्टव्यू देखना चाहता हूं, मुझे पता है कि मैं इसके लिए क्षैतिज स्क्रॉलव्यू का उपयोग करता हूं और मैं चाहता हूं कि पाठ निरंतर स्वत: स्क्रॉल हो। क्या यह संभव है?एंड्रॉइड में टेक्स्ट व्यू कैसे प्राप्त करें क्षैतिज स्क्रॉलिंग और स्वत: स्क्रॉल किया गया है?

उत्तर

4

आप android इस्तेमाल कर सकते हैं: TextView में जिम्मेदार बताते हैं एल्लिप्साइज = "मार्की" या अपना स्वयं का एनीमेशन

+3

एक ओर ध्यान दें: डिफ़ॉल्ट मार्की एनीमेशन केवल तभी TextView चयनित होने शुरू होता है। –

1

यह ऑटो स्क्रॉल पाठ दृश्य बस XML का उपयोग के लिए छोटा सा उदाहरण है लागू, जावा कोड करने के लिए कोई जरूरत नहीं। अपेक्षा है कि आप को यह पसंद आऐगा! अपने दम पर यह प्रयास करें, यह प्रदर्शन करने के लिए

इस प्रयास करें बहुत आसान है:

<TextView 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:singleLine="true" 
android:scrollHorizontally="true" 
android:ellipsize="marquee" 
android:marqueeRepeatLimit ="marquee_forever" 
android:focusable="true" 
android:focusableInTouchMode="true" 
android:text="This is small example for auto scroll text view simply using XML, no need to code Java. Hope you like it! Try it on your own, it is very easy to perform" /> 

Click here to see the Output

यहाँ पाठ स्वचालित रूप से स्क्रॉल करेगा और आप अनंत स्क्रॉल मिल जाएगा। मज़े करो!

Click here to see detailed tutorial

संबंधित मुद्दे