我們在上網(wǎng)的過程中經(jīng)??吹礁鞣N圖片,那你知道它是如何實現(xiàn)的嗎?接下來就讓我們一塊探討一下。
網(wǎng)絡(luò)圖片的瀏覽可以分為倆部分,基本的頁面布局與界面交互,讓我們一步步的來編寫。
基本布局很簡單,只需要有一個輸入圖片鏈接的EditText,一個瀏覽按鈕,一個ImageView就差不多了。下面是簡單代碼。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <ImageView android:id="@+id/iv" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" /> <EditText android:id="@+id/et_path" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="請輸入圖片路徑" android:maxLines="1" /> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:onClick="click" android:text="瀏覽" /> </LinearLayout>
分享題目:Android實現(xiàn)網(wǎng)絡(luò)圖片瀏覽功能-創(chuàng)新互聯(lián)
文章URL:http://aaarwkj.com/article48/dohchp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、網(wǎng)站改版、做網(wǎng)站、搜索引擎優(yōu)化、靜態(tài)網(wǎng)站、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容