這篇文章將為大家詳細講解有關android中怎么實現一個商品詳情頁面,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
布局文件骨架:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <!--因為要在整體布局右下角放一個置頂圖標,所以用frameLayout包裹一下--> <FrameLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <!--自定義的相對布局--> <www.gd.com.goodsdetails.view.ScrollViewContainer android:layout_width="match_parent" android:layout_height="match_parent"> <!--上半區域的scrollview,因為上半區域也要滑動--> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <FrameLayout android:layout_width="match_parent" android:layout_height="240dp"> <!--這塊區域放輪播圖--> </FrameLayout> <FrameLayout android:layout_width="match_parent" android:layout_height="500dp"> <!--這塊區域放商品詳情信息--> </FrameLayout> <!-- 中間繼續拖動條目(繼續拖動,查看圖文詳情) 可以根據產品需求更改自己想要的樣式(一般這里都是一些簡單的文字) --> <RelativeLayout android:layout_width="match_parent" android:layout_height="40dp"> ...... </RelativeLayout> </LinearLayout> </ScrollView><!--結束:上半區域的scrollview--> <!--下面需要顯示的webview了--> <WebView android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" /> </www.gd.com.goodsdetails.view.ScrollViewContainer> <!--一鍵滑到頂部的圖片--> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:layout_margin="15dp" /> </FrameLayout> <!--*******************************************************--> <!--這些無關緊要,“進入店鋪”,“立即購買”--> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <span > </span>...... </LinearLayout> </LinearLayout>
關于android中怎么實現一個商品詳情頁面就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。