`

iconify使用文本替换icon测试

阅读更多
源项目地址
https://github.com/JoanZapata/android-iconify


测试代码:
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ViewPager viewPager=(ViewPager)findViewById(R.id.viewPager);
        TabLayout tabLayout=(TabLayout)findViewById(R.id.tabs);
        // Fill view pager
        viewPager.setAdapter(new FontIconsViewPagerAdapter(Font.values()));
        tabLayout.setupWithViewPager(viewPager);
    }

}


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.example.testiconify.MainActivity" >

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        app:tabGravity="fill"
        app:tabIndicatorColor="#FFFF0000"
        app:tabIndicatorHeight="4dp"
        app:tabMode="scrollable"
        app:tabSelectedTextColor="#FFFF0000"
        app:tabTextColor="#FFCCCCCC" />

    <android.support.v4.view.ViewPager
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

  • TestIconify.rar (5.4 MB)
  • 描述: eclipse版本,需要v7-appcompat,design等包
  • 下载次数: 1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics