西西軟件園多重安全檢測(cè)下載網(wǎng)站、值得信賴的軟件下載站!
軟件
軟件
文章
搜索

首頁(yè)編程開發(fā)其它知識(shí) → 可循環(huán)顯示圖像的Android Gallery組件

可循環(huán)顯示圖像的Android Gallery組件

相關(guān)軟件相關(guān)文章發(fā)表評(píng)論 來源:本站整理時(shí)間:2010/8/24 0:14:12字體大。A-A+

作者:佚名點(diǎn)擊:2798次評(píng)論:0次標(biāo)簽: Android 循環(huán)

  • 類型:源碼相關(guān)大。23.6M語言:中文 評(píng)分:9.1
  • 標(biāo)簽:
立即下載
4 頁(yè) 實(shí)現(xiàn)循環(huán)顯示圖像的Gallery組件
實(shí)現(xiàn)循環(huán)顯示圖像的Gallery組件


<!--[endif]-->
在本節(jié)將組出與循環(huán)顯示圖像相關(guān)的ImageAdapter類的完整代碼。讀者可以從中看到上一節(jié)介紹的兩點(diǎn)改進(jìn)。為了使界面看上去更豐滿,本例還在單擊某一個(gè)Gallery組件中的圖像時(shí)在下方顯示一個(gè)放大的圖像(使用ImageSwitcher組件)。本例的顯示效果如圖3所示。當(dāng)不斷向后移動(dòng)圖像時(shí),圖像可不斷顯示,讀者可以自己運(yùn)行本例來體驗(yàn)一下。

 
<!--[endif]-->
在main.xml文件中定義的Gallery和ImageSwitcher組件的代碼如下:


代碼
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Gallery android:id="@+id/gallery" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_marginTop="30dp" />
    <ImageSwitcher android:id="@+id/imageswitcher"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:layout_marginTop="30dp" />
</LinearLayout>

    相關(guān)評(píng)論

    閱讀本文后您有什么感想? 已有人給出評(píng)價(jià)!

    • 8 喜歡喜歡
    • 3 頂
    • 1 難過難過
    • 5 囧
    • 3 圍觀圍觀
    • 2 無聊無聊

    熱門評(píng)論

    最新評(píng)論

    發(fā)表評(píng)論 查看所有評(píng)論(0)

    昵稱:
    表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
    字?jǐn)?shù): 0/500 (您的評(píng)論需要經(jīng)過審核才能顯示)