新版 微信网页分享到微信代码底部 导航栏 有没有代码取消的

微信小程序API设置导航条,wx.setNavigationBarTitle动态设置当前页面的标题_Hi小程序
微信小程序API设置导航条,wx.setNavigationBarTitle动态设置当前页面的标题
|HiShop|阅读量:
导读:wx.setNavigationBarTitle(OBJECT) 动态设置当前页面的标题。 OBJECT参数说明: 参数 类型 必填 说明 title String 是 页面标题 success Function 否 接口调用成功的回调函数 fail Function 否 接口调用失败的...
Hi小程序小编了解到,微信小程序成为当下热门话题,下面从多个方面来谈谈微信小程序API设置导航条,wx.setNavigationBarTitle动态设置当前页面的标题。
最新消息,
wx.setNavigationBarTitle(OBJECT)
动态设置当前页面的标题。
OBJECT参数说明:
接口调用成功的回调函数
接口调用失败的回调函数
接口调用结束的回调函数(调用成功、失败都会执行)
示例代码:
wx.setNavigationBarTitle({
title: '当前页面'
在当前页面显示导航条加载动画。
隐藏导航条加载动画。
wx.setNavigationBarColor(OBJECT)
基础库 1.4.0 开始支持,低版本需做兼容处理
OBJECT参数说明:
frontColor
前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000
backgroundColor
背景颜色值,有效值为十六进制颜色
animation.duration
动画变化时间,默认0,单位:毫秒
animation.timingFunc
动画变化方式,默认 linear
接口调用成功的回调函数
接口调用失败的回调函数
接口调用结束的回调函数(调用成功、失败都会执行)
animation.timingFunc 有效值:
动画从头到尾的速度是相同的。
动画以低速开始
动画以低速结束。
动画以低速开始和结束。
success返回参数说明:
示例代码:
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ff0000',
animation: {
duration: 400,
timingFunc: 'easeIn'
更多教程,可以关注hi小程序。
  深圳通+小程序是深圳推出的一项乘车新体验,目前深圳全市所有地面公交车辆
猜你喜欢的内容
类微信开发文档
类微信小程序开发实例
小程序产品推荐
移动云商城
一款会赚钱的网上商城系统——移动云商城,让零售企业转型电商更简单!独创6合一全网营销模式、裂变式推广分佣快速吸粉引流,不论微信、APP、手机触屏还是PC端网上购物商城,只要1个后台即可掌控全网最火爆的6大商城!
小程序基础入门
热门小程序
读过此文的人还读过
官方微信>>>仿微信底部固定二级导航菜单-freejs.net代码演示
&&&&仿微信底部固定二级导航菜单()
仿微信底部固定二级导航菜单
&script&type=&text/javascript&&&&
window.onload&=&function(){&&
&&&&$('#menu&ul&li').each(function(j){&&
&&&&&&&&$('#menu&ul&li').eq(j).removeClass(&on&);&&
&&&&&&&&$('#menu&ul&li&span').eq(j).animate({bottom:-$('#menu&ul&li&span').eq(j).height()},100);&&
$('#menu&ul&li').each(function(i){&&
&&&&$(this).click(function(){&&
&&&&&&&&if($(this).attr(&class&)!=&on&){&&
&&&&&&&&&&&&$('#menu&ul&.on&span').animate({bottom:-$('#menu&ul&.on&span').height()},200);&&
&&&&&&&&&&&&$('#menu&ul&.on').removeClass(&on&);&&
&&&&&&&&&&&&$(this).addClass(&on&);&&
&&&&&&&&&&&&$('#menu&ul&li&span').eq(i).animate({bottom:35},200);&&
&&&&&&&&&&&&$('.footer_front').show();&&
&&&&&&&&}else{&&
&&&&&&&&&&&&$('#menu&ul&li&span').eq(i).animate({bottom:-$('#menu&ul&li&span').eq(i).height()},200);&&
&&&&&&&&&&&&$(this).removeClass(&on&);&&
&&&&&&&&&&&&$('.footer_front').hide();&&
&&&&&&&&}&&
$('.footer_front').click(function(){&&
&&&&$('#menu&ul&.on&span').animate({bottom:-$('#menu&ul&.on&span').height()},200);&&
&&&&$('#menu&ul&.on').removeClass(&on&);&&
&&&&$(this).hide();&&
&/script&&&
&id=&menu&&&
&&&&&&&&&&
&&&&&&&&&&&&&class=&menu_li&&src=&images/coin.png&&width=&10&&&网页特效&&
&&&&&&&&&&&&&class=&line&&src=&images/line.png&&width=&1&&&
&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&src=&images/navbg4.png&&width=&100%&&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/fenye.html&分页&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/biaodan.html&表单&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/daohangcaidan.html&导航菜单&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/tabbiaoqian.html&TAB标签&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&&&&&&class=&menu_li&&src=&images/coin.png&&width=&10&&&Freejs.net&&
&&&&&&&&&&&&&class=&line&&src=&images/line.png&&width=&1&&&&
&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&src=&images/navbg4.png&&width=&100%&&&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/fenye.html&分页&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/biaodan.html&表单&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/daohangcaidan.html&导航菜单&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/tabbiaoqian.html&TAB标签&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&&&&&&class=&menu_li&&src=&images/coin.png&&width=&10&&&jquery&特效&&
&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&src=&images/navbg5.png&&width=&100%&&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/fenye.html&分页&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/biaodan.html&表单&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/daohangcaidan.html&导航菜单&&
&&&&&&&&&&&&&&&&&href=&http://www.freejs.net/tabbiaoqian.html&TAB标签&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&
&&&&&&&&&&
&原文地址:当前位置: >
仿微信自定义菜单全屏自适应手机底部弹出菜单js特效代码
20:59 来源/作者:懒人模板 分类: 
* 懒人模板承诺:本站所有资源免费下载,无病毒,无弹窗,无干扰链接!
猜你也喜欢看这些 ??????
这些是最新的 ??????
我们一直在进步
日 懒人模板官网论坛上线!
日 微信贺卡源码频道上线!
日 手机单页专题频道上线!
微信游戏源码频道上线!
05年3月10日 手机单页专题频道上线!
10月18日 懒人模板手机版正式上线!
8月21日 关键词“wap模板”首页排名前一!
8月17日 关键词“手机模板”首页排名前四!
08月12日 关键词“手机wap网站模板”首页排名第一!Android仿微信页面底部导航效果代码实现
转载 &更新时间:日 14:46:11 & 作者:时代新人
本文给大家分享一段代码有关android仿微信页面底部导航效果代码实现的思路,非常不错,感兴趣的朋友一起看看吧
大家在参考本地代码的时候要根据需要适当的修改,里面有冗余代码小编没有删除。好了,废话不多说了,一切让代码说话吧!
关键代码如下所示:
.java里面的主要代码
public class MainActivity extends BaseActivity implements TabChangeListener {
private Fragment[]
private FragZaiXianYuYue fragZaiXianYuY
private FragDaoLuJiuYuan fragDaoLuJiuY
private FragJiFenShangCheng fragJiFenShangC
private FragMe fragMe;
private ImageView img_
private ImageView[]
private ImageView img_me_
private TextView[]
private int currentTabI// 当前fragment的index
private int keyBackClickCount = 0;
private int indexC
private boolean isChangeTab =
protected void onCreate(Bundle arg0) {
// TODO Auto-generated method stub
super.onCreate(arg0);
setContentView(R.layout.mainactivity);
initView();
initTabView();
FragBYRecord.setTabChangeListener(this);
FragWXRecord.setTabChangeListener(this);
registerMessageReceiver();
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
isForeground =
requestMaintenance();
if (isChangeTab) {
if (indexChange == 0) {
viewTitle.setZhongJianText(R.string.frag_zxyy);
tv_left.setVisibility(View.GONE);
} else if (indexChange == 0) {
viewTitle.setZhongJianText(R.string.frag_dljy);
tv_left.setVisibility(View.GONE);
changeTab(indexChange);
isChangeTab =
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
isForeground =
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
if(null != mMessageReceiver)
unregisterReceiver(mMessageReceiver);
private void initView() {
viewTitle = (ViewTitle) findViewById(R.id.title_bar);
img_right = viewTitle.getYoubianView();
img_right.setVisibility(View.VISIBLE);
tv_left = viewTitle.getZuobianTextView();
viewTitle.getZuobianView().setVisibility(View.GONE);
tv_left.setText("XXXX");
img_right.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent intent = new Intent(MainActivity.this,
MineActivity.class);
MineActivity.mFragValue = MineActivity.FRAG_SYSTEMMESSAGE;
startActivity(intent);
tv_left.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
fragMe.addNewCar();
private void initTabView() {
fragZaiXianYuYue = new FragZaiXianYuYue();
fragDaoLuJiuYuan = new FragDaoLuJiuYuan();
fragJiFenShangCheng = new FragJiFenShangCheng();
fragMe = new FragMe();
fragments = new Fragment[] { fragZaiXianYuYue, fragDaoLuJiuYuan,
fragJiFenShangCheng, fragMe };
imagebuttons = new ImageView[4];
imagebuttons[0] = (ImageView) findViewById(R.id.ib_zzyy);
imagebuttons[1] = (ImageView) findViewById(R.id.ib_dljy);
imagebuttons[2] = (ImageView) findViewById(R.id.ib_jfsc);
imagebuttons[3] = (ImageView) findViewById(R.id.ib_me);
img_me_notity = (ImageView) findViewById(R.id.ib_me_notity);
imagebuttons[0].setSelected(true);
viewTitle.setZhongJianText(R.string.frag_zxyy);
textviews = new TextView[4];
textviews[0] = (TextView) findViewById(R.id.tv_ib_zzyy);
textviews[1] = (TextView) findViewById(R.id.tv_dljy);
textviews[2] = (TextView) findViewById(R.id.tv_jfsc);
textviews[3] = (TextView) findViewById(R.id.tv_me);
textviews[0]
.setTextColor(getResources().getColor(R.color.color_yellow));
// 添加显示第一个fragment
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, fragZaiXianYuYue)
.add(R.id.fragment_container, fragDaoLuJiuYuan)
.add(R.id.fragment_container, fragJiFenShangCheng)
.add(R.id.fragment_container, fragMe).hide(fragDaoLuJiuYuan)
.hide(fragJiFenShangCheng).hide(fragMe).show(fragZaiXianYuYue)
.commit();
public void onTabClicked(View view) {
switch (view.getId()) {
case R.id.re_zzyy:
index = 0;
if (fragZaiXianYuYue != null) {
viewTitle.setZhongJianText(R.string.frag_zxyy);
tv_left.setVisibility(View.GONE);
changeTab(index);
case R.id.re_dljy:
index = 1;
viewTitle.setZhongJianText(R.string.frag_dljy);
tv_left.setVisibility(View.GONE);
changeTab(index);
case R.id.re_jfsc:
if(SharePreferUtil.getBoolean(CommonString.HAVESERVICE, false)){
index = 2;
viewTitle.setZhongJianText(R.string.frag_jfsc);
tv_left.setVisibility(View.GONE);
fragJiFenShangCheng.requestJudgeCar();
changeTab(2);
if(SharePreferUtil.getBoolean("isFristGoShop", true)){
SharePreferUtil.putBoolean("isFristGoShop", false);
fragJiFenShangCheng.mengcengDialog();
showAddServiceDialog();
case R.id.re_me:
index = 3;
viewTitle.setZhongJianText(R.string.frag_me);
tv_left.setVisibility(View.VISIBLE);
changeTab(index);
public void changeTab(int index) {
if (currentTabIndex != index) {
FragmentTransaction trx = getSupportFragmentManager()
.beginTransaction();
trx.hide(fragments[currentTabIndex]);
if (!fragments[index].isAdded()) {
trx.add(R.id.fragment_container, fragments[index]);
trx.show(fragments[index]).commit();
imagebuttons[currentTabIndex].setSelected(false);
// 把当前tab设为选中状态
imagebuttons[index].setSelected(true);
textviews[currentTabIndex].setTextColor(getResources().getColor(
R.color.white));
textviews[index].setTextColor(getResources().getColor(
R.color.color_yellow));
currentTabIndex =
mainactivity.xml:
&include layout="@layout/layout_bottom"/&
layout_bottom.xml:
&?xml version="1.0" encoding="utf-8"?&
&LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/black"
android:orientation="vertical" &
&!-- 普通底部导航 --&
&LinearLayout
android:id="@+id/main_bottom"
android:layout_width="match_parent"
android:layout_height="54dp"
android:gravity="center_vertical"
android:orientation="horizontal" &
&RelativeLayout
android:id="@+id/re_zzyy"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="onTabClicked"
android:padding="3dp" &
&RelativeLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center" &
&ImageView
android:id="@+id/ib_zzyy"
android:layout_width="30dp"
android:layout_height="28dp"
android:layout_centerHorizontal="true"
android:focusable="false"
android:scaleType="centerInside"
android:src="@drawable/tab_zaixianyuyue" /&
android:id="@+id/tv_ib_zzyy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/ib_zzyy"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:textColor="@color/white"
android:text="@string/frag_zxyy"
android:textSize="12sp" /&
&/RelativeLayout&
&/RelativeLayout&
&RelativeLayout
android:id="@+id/re_dljy"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="onTabClicked"
android:padding="3dp" &
&RelativeLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center" &
&ImageView
android:id="@+id/ib_dljy"
android:layout_width="30dp"
android:layout_height="28dp"
android:layout_centerHorizontal="true"
android:focusable="false"
android:scaleType="centerInside"
android:src="@drawable/tab_daolujiuyuan" /&
android:id="@+id/tv_dljy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/ib_dljy"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:textColor="@color/white"
android:text="@string/frag_dljy"
android:textSize="12sp" /&
&/RelativeLayout&
&/RelativeLayout&
&RelativeLayout
android:id="@+id/re_jfsc"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="onTabClicked"
android:padding="3dp" &
&RelativeLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center" &
&ImageView
android:id="@+id/ib_jfsc"
android:layout_width="30dp"
android:layout_height="28dp"
android:layout_centerHorizontal="true"
android:focusable="false"
android:scaleType="centerInside"
android:src="@drawable/tab_jifenshangcheng" /&
android:id="@+id/tv_jfsc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/ib_jfsc"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:textColor="@color/white"
android:text="@string/frag_jfsc"
android:textSize="12sp" /&
&/RelativeLayout&
&/RelativeLayout&
&RelativeLayout
android:id="@+id/re_me"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="onTabClicked"
android:padding="3dp" &
&RelativeLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center" &
&ImageView
android:id="@+id/ib_me"
android:layout_width="30dp"
android:layout_height="28dp"
android:layout_centerHorizontal="true"
android:focusable="false"
android:scaleType="centerInside"
android:src="@drawable/tab_me" /&
&ImageView
android:id="@+id/ib_me_notity"
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_alignTop="@+id/ib_me"
android:layout_alignRight="@+id/ib_me"
android:scaleType="centerInside"
android:src="@drawable/app_34_icon_point_normal"
android:visibility="gone" /&
android:id="@+id/tv_me"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/ib_me"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:textColor="@color/white"
android:text="@string/frag_me"
android:textSize="12sp" /&
&/RelativeLayout&
&/RelativeLayout&
&/LinearLayout&
&/LinearLayout&
以上所述是小编给大家介绍的Android仿微信页面底部导航效果代码实现,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具只需一步,快速开始
扫一扫,登录网站
后使用快捷导航没有帐号?
微信小程序设置底部导航栏目方法
小程序底部想要有一个漂亮的导航栏目,不知道怎么制作,于是百度找到了本篇文章,分享给大家。好了 小程序的头部标题 设置好了,我们来说说底部导航栏是如何实现的。我们先来看个效果图这里,我们添加了三个导航图标 ...
底部想要有一个漂亮的导航栏目,不知道怎么制作,于是百度找到了本篇文章,分享给大家。好了 小程序的头部标题 设置好了,我们来说说底部导航栏是如何实现的。我们先来看个效果图这里,我们添加了三个导航图标,因为我们有三个页面,小程序最多能加5个。那他们是怎么出现怎么着色的呢?两步就搞定!&1. 图标准备阿里图标库 &我们进入该网站,鼠标滑到一个喜欢的图标上面 &点击下方的 下载按钮在弹出框中 选择了 俩个不同颜色的 图标 &选择64px大小即可,我选择的是png &然后下载下来 起上别名&将上述起好名字的图标 保存到 小程序 项目目录中 新创建的 images 文件夹中,准备工作就做好了&2. 更改配置文件我们找到项目根目录中的配置文件 app.json 加入如下配置信息&解释一下 对应的属性信息&&tabBar&&指底部的 导航配置属性color&&未选择时 底部导航文字的颜色selectedColor&&选择时 底部导航文字的颜色borderStyle&&底部导航边框的样色(注意&这里如果没有写入样式 会导致 导航框上边框会出现默认的浅灰色线条)list&& 导航配置数组selectedIconPath&选中时 图标路径iconPath&未选择时 图标路径pagePath&页面访问地址text&&导航图标下方文字
刚表态过的朋友 ()
原作者: 陈达辉}

我要回帖

更多关于 网页一键关注微信代码 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信