本文實例為大家分享了Android實現3D標簽云效果展示的具體代碼,供大家參考,具體內容如下

一、關于3D標簽云
TagCloudView是一個完全基于Android ViewGroup編寫的控件,支持將一組View展示為一個3D標簽云,并支持全方向滾動。
GitHub中的鏈接地址
(一)效果
頁面上標簽的數據可以自己定義,數據頁面可以滑動選擇。
(二)AndroidStudio中使用
1.在build.gradle中添加
compile ‘com.moxun:tagcloudlib:1.0.3'
2.在布局文件中引入
3.設置Adapter 繼承TagsAdapter,實現以下方法
(1)public int getCount();
返回Tag數量
(2)public View getView(Context context, int position, ViewGroup parent);
返回每個Tag實例
(3)public Object getItem(int position);
返回Tag數據
(4)public int getPopularity(int position);
針對每個Tag返回一個值,但是什么作用
4.標簽云對象的屬性設置
二、簡單的使用示例
(一)布局文件activity_main.xml設計
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent"> <com.moxun.tagcloudlib.view.TagCloudView android:id="@+id/tcv_tags" android:layout_width="match_parent" android:layout_height="match_parent" app:autoScrollMode="uniform" app:radiusPercent="0.8" /> </RelativeLayout>
網站題目:Android實現3D標簽云簡單效果-創新互聯
文章起源:http://www.yijiale78.com/article8/cdpsip.html
成都網站建設公司_創新互聯,為您提供移動網站建設、網頁設計公司、搜索引擎優化、響應式網站、營銷型網站建設、面包屑導航
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯