The screen of a mobile phone is relatively small. Sometimes you need to use a text box (TextView or its subclass) to display a long line of text. One way is to cut the text, use... .
A common practice is to use Marquee to scroll text. This example describes the Marquee Effect of TextView.
Let's take a look at the definition of marquee. xml in layout:
[Html]Androi
Android:textview automatic scrolling (marquee)TextView implementation of text scrolling requires the following points: 1. Text length is longer than can be displayed range: Android:singleline= "true" 2. Set scroll to, or display style: android:ellipsize= "marquee" 3. TextView The hidden text is only scrolled when the focus is taken, so you need to create a new class in the package to inherit the TextView. O
In the Android Apidemo, there is a button merry-go effect, but the change is TextView, or a little difference.
Define MERRY-GO (Marquee), mainly in Project/res/layout/main.xml
Copy Code code as follows:
Android:layout_width= "40px"
android:layout_height= "Wrap_content"
android:text= "Test marquee for TextView"
android:layout_gravity= "Center"
Android:ellipsize= "
One of the implementation principles of IOS image carousel and ios carouselIOS image carousel implementation principle
Image rotation is to display different images in a display area by sliding.
When there are few images, we can add many images to the scroll view.
However, if the number of images is large, loading too many images at a time will waste memory and affect performance.
Therefore, we need t
Js manual playback of images to achieve image carousel effect, js image carousel
This article provides examples to share the specific implementation code of js image carousel for your reference. The specific content is as follows:
I. html code section (et. thtml ):
Ii. css code section (styleet, css ):
#main span{ width: 22px; height: 38px; position: absolute
Implementation results:Implementation principle:
Technology stack:
Javascript+jquery+html+css
Implementation steps:
0. Get element
1. The mouse is placed on the carousel chart, showing the control buttons on both sides, and hiding after moving away
2. Control button binding events for both sides (call the same method with only one argument, true for positive rotation, false for reverse rota
Unlimited image carousel-the simplest way to achieve unlimited image carousel
In collectionView, only three cells are displayed as the second cell.
-(UICollectionViewCell *) collectionView :( UICollectionView *) collectionView cellForItemAtIndexPath :( NSIndexPath *) indexPath {
CycleViewCell * cell = [collectionViewdequeueReusableCellWithReuseIdentifier: @ "Cell" forIndexPath: indexPath];
// IndexPath. i
CSS3 implements simple carousel images and css3 carousel Images
The principle is to change the left value when CSS 3 is used to implement image switching. Only the simplest automatic playback function is available. After switching, the system remains static for a short time. The first image is cloned at the last position to achieve seamless switching.
Html Structure
Css style
* {Margin: 0; padding: 0; text
Overview of ECMAScript6 carousel chart practices, ecmascript6 carousel chart
Template string
This is one of my favorite features of ES6. It intuitively reflects the relationship between variables and strings. In ES5, if we want to add variables to strings, We need to write the following code:
animate(box, 'translate(-' + itemWidth * num + 'px,0)', 1000, function () { box.style.transitionDuration = ''; box
TextView Simple EffectTextView Android:text="@string/longword"Android:layout_width="wrap_content"Android:layout_height="wrap_content"Android:id="@+id/textview1"android:ellipsize="Marquee"Android:singleline="true"android:focusable="true"Android:focusableintouchmode="true"/>TextView a few of the common properties of the marquee effect, of which ellipsize, Singleline, focusable, Focusableintouchmode are requir
Implement a seamless rolling plug-in for marquee Based on jQuery, jquerymarquee
JQuery-based plug-ins that implement seamless marquee scrolling have been released to git.oschina.net to demonstrate later updates (updated to the http://git.oschina.net/mqycn/jQueryMarquee ).
The Code is as follows:
/*** Class library name: jQuery. marquee * Implementation function:
To make text in TextView scroll, you must meet the following factors:
1,textview text width over textview width2,android:ellipsize= "Marquee"3, scrolling only occurs when TextView gets the focus. So add Android:focusableintouchmode= "true" android:focusable= "true"The easiest thing to ignore is the third one.
Scrolling repeat number setting:
android:marqueerepeatlimit= "Marquee_forever"
Look at a TextView property android:ellipsize to realize the
Marquee was abandoned by W3C. This sentence is actually incorrect. Why? Because Marquee has never been regarded as a formal tag by W3C. In the forum, I saw the netizen jeanjean20 mentioned how to modify Marquee to meet the standards. I read my friends' posts and thought it was quite good. The moderator greengnn indicated that
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.