多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內(nèi)最全I(xiàn)T社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁 > php開源 > 綜合技術(shù) > 自定義控件---系統(tǒng)控件組合式(案例二)

自定義控件---系統(tǒng)控件組合式(案例二)

來源:程序員人生   發(fā)布時(shí)間:2015-03-26 09:13:33 閱讀次數(shù):2539次

-----------------------------------------------案例效果-------------------------------------


activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v4.view.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="200dip" /> <LinearLayout android:gravity="center_horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignBottom="@id/viewPager" android:background="#44000000" android:orientation="vertical" > <TextView android:singleLine="true" android:id="@+id/tv_msg" android:textColor="#ffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="武媚娘傳奇" android:textSize="18sp" /> <LinearLayout android:id="@+id/ll_point_group" android:padding="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > </LinearLayout> </LinearLayout> </RelativeLayout>
drawable目錄下有3個(gè)xml文件
point_bg.xml

<?xml version="1.0" encoding="utf⑻"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_enabled="false" android:drawable="@drawable/normal_point"></item> <item android:state_enabled="true" android:drawable="@drawable/focused_point"></item> </selector>
normal_point.xml

<?xml version="1.0" encoding="utf⑻"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <size android:width="10dip" android:height="10dip"/> <solid android:color="#55000000"/> </shape>
focused_point.xml

<?xml version="1.0" encoding="utf⑻"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <!-- 橢圓 --> <size android:width="10dip" android:height="10dip"/> <solid android:color="#66ffffff"/> </shape>

MainActivity.java

package com.atguigu.myviewpager; import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; public class MainActivity extends Activity { // viewPager繼承viewGroup private ViewPager viewPager; private TextView tv_msg; // 顯示當(dāng)前頁的圓點(diǎn)標(biāo)志布局視圖 private LinearLayout ll_point_group; /** * 圖片的int數(shù)組集合 圖片標(biāo)題集合 圖片集合 */ private int[] ids = { R.drawable.a, R.drawable.b, R.drawable.c, R.drawable.d, R.drawable.e }; private final String[] imageDescriptions = { "鞏俐不低俗,我就不能低俗", "樸樹又回來啦!再唱經(jīng)典老歌引萬人大合唱", "揭秘北京電影如何升級", "樂視網(wǎng)TV版大派送", "熱血
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 国产精品久久久精品三级 | 亚洲和欧美毛片久久久久 | 午夜小视频网站 | 欧美 日韩 国产 成人 在线观看 | 国产一区二区三区播放 | 国产午夜视频在线观看第四页 | 精品国产亚洲一区二区三区 | 在线观看视频一区二区三区 | 亚洲高清在线天堂精品 | a网站免费 | 久久久久久久国产精品 | 亚洲成年人在线观看 | 在线观看视频亚洲 | 亚洲经典一区二区三区 | 亚洲精品一区二区三区在线播放 | 亚洲欧美日韩精品久久亚洲区 | 日本一区二区三区四区在线观看 | free欧美xxxxvideo| 亚洲第一成人在线 | 亚洲高清在线视频 | 国产一区二区三区免费 | 成人自拍在线 | 国产女人成人精品视频 | 美女网站视频免费 | 成人免费小视频 | 国产精品久久久亚洲 | 77777视频| 被两个男人吃奶添下面视频 | 成年视频国产免费观看 | 一级女性全黄久久生活片免费 | 亚洲国产精品第一区二区三区 | 国产精品精品国产一区二区 | 91精品福利一区二区 | 在线观看日本永久免费视频 | 视频久久精品 | 色播亚洲| 精品动漫第一页 | 精品视频69v精品视频 | 国产日韩欧美一区 | 亚洲伊人成人网 | 爱爱网网站免费观看 |