Font Awesome Text 使用方法

來源:互聯網
上載者:User

標籤:android   http   color   java   使用   os   io   for   

<!-- basic text--><com.beardedhen.androidbootstrap.FontAwesomeText    android:layout_width="wrap_content"    android:layout_height="wrap_content"    fontawesometext:fa_icon="fa-github"    android:layout_margin="10dp"     android:textSize="32sp"/>

fontawesometext:fa_icon="fa-github" the icon to place, as per the Font Awesome Cheat Sheet

android:textSize="12sp" Text size must always be in sp!

android:textColor="@color/bbutton_primary" you can change the textColor or background to any color, including the Bootstrap colours by typing bbutton_ and the type of colour e.g. bbutton_danger for the red danger colour.

NEW

fontAwesomeText.setIcon("fa-heart"); change the icon programmatically

Animations
//get access to some FontAwesomeText items in the layoutFontAwesomeText tv1 = (FontAwesomeText) findViewById(R.id.lblOne);FontAwesomeText tv2 = (FontAwesomeText) findViewById(R.id.lblTwo);FontAwesomeText tv3 = (FontAwesomeText) findViewById(R.id.lblThree);//flashing forever FASTtv1.startFlashing(this, true, FontAwesomeText.AnimationSpeed.FAST);//rotating clockwise slowlytv2.startRotate(this, true, FontAwesomeText.AnimationSpeed.SLOW);//rotating anti-clockwise at medium speedtv3.startRotate(this, false, FontAwesomeText.AnimationSpeed.MEDIUM);
Flashing Animations

startFlashing(Context context, boolean forever, AnimationSpeed speed);

@param context the current applications context

@param forever whether the item should flash repeatedly or just once

@param speed how fast the item should flash, chose between FontAwesomeText.AnimationSpeed.SLOW / FontAwesomeText.AnimationSpeed.MEDIUM / FontAwesomeText.AnimationSpeed.FAST

Rotation Animation

startRotate(Context context, boolean clockwise, AnimationSpeed speed);

@param context the current applications context

@param clockwise true for clockwise, false for anti clockwise spinning

@param speed how fast the item should flash, chose between FontAwesomeText.AnimationSpeed.SLOW / FontAwesomeText.AnimationSpeed.MEDIUM / FontAwesomeText.AnimationSpeed.FAST

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.