zoukankan      html  css  js  c++  java
  • Font Awesome Text 使用方法

    <!-- 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 layout
    FontAwesomeText tv1 = (FontAwesomeText) findViewById(R.id.lblOne);
    FontAwesomeText tv2 = (FontAwesomeText) findViewById(R.id.lblTwo);
    FontAwesomeText tv3 = (FontAwesomeText) findViewById(R.id.lblThree);
    
    //flashing forever FAST
    tv1.startFlashing(this, true, FontAwesomeText.AnimationSpeed.FAST);
    
    //rotating clockwise slowly
    tv2.startRotate(this, true, FontAwesomeText.AnimationSpeed.SLOW);
    
    //rotating anti-clockwise at medium speed
    tv3.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

  • 相关阅读:
    sql注入漏洞与防范
    微信小程序-工具,弹出当前系统代理不是安全代理处理方法
    微信小程序-02 小程序关注组件
    微信小程序-01 小数保留二位
    http 转hhttps
    php 函数-ksort
    iOS 原生二维码扫描
    iOS 打包错误 all-product-headers.yaml' not found
    iOS Tableview点击cell 会往上跳
    WKWebView 使用
  • 原文地址:https://www.cnblogs.com/boundary/p/3880767.html
Copyright © 2011-2022 走看看