<强> 1。先来张效果图强>
<强> 2。自定义一个角标工具类BottomBarView。强>
Arunachal Pradesh, *由管理员> & lt; & # 63; xml version=" 1.0 " encoding=" utf - 8 " & # 63;比; & lt; RelativeLayout xmlns: android=" http://schemas.android.com/apk/res/android " android: layout_width=" match_parent " android: layout_height=" wrap_content " 比; & lt; ImageView android: id=癅 + id/imggwc” android: layout_width=" wrap_content " android: layout_height=" wrap_content " android: layout_centerVertical=" true " android: layout_toLeftOf=癅 + id/imggenduo” android: src=" https://www.yisu.com/zixun/@drawable chaoshi_shopping_nav_icon "/比; & lt; TextView android: id=癅 + id/子” android: layout_width=" wrap_content " android: layout_height=" wrap_content " android: layout_marginLeft=" -12 dp” android: layout_toRightOf=癅 + id/imggwc” android:背景=" @drawable/red_dot_bg” android:文本=" 1 " android:重力="中心" android:输入textColor=" # FFFFFF " android: textSize=" 10 dp/比; & lt;/RelativeLayout> >之前<强> 4.活动的实现强>
公共静态BottomBarView fragment_bottom_bar; fragment_bottom_bar=(BottomBarView) findViewById (R.id.fragment_bottom_bar);//购物车数量角标数据 公共静态最终无效gwcsl () { String> Map<字符串;地图=new HashMap<字符串,String> (); map.put (ConstantUtil。令牌,SpUtil.get (ConstantUtil。令牌," ")); NormalPostRequest npr=new NormalPostRequest (MyUrlUtils.getFullURL (BaseServerConfig.CSGWCSL), 新的Response.Listener() { @Override 公共空间> & lt;使用 android: id=癅 + id/csgwcdj” android: layout_width=" 45 dp " android: layout_height=" match_parent " android: layout_toLeftOf=癅 + id/相对”比; & lt; com.zjtd.bzcommunity.view.BottomBarView android: id=癅 + id/fragment_bottom_bar” android: layout_width=" match_parent " android: layout_height=" wrap_content " android: layout_centerVertical=" true "/比; & lt;/RelativeLayout> 其实这个小功能很简单,只是你们想得太复杂.......
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持!
Android实现购物车及其他功能的角标