小程序
小游戏
企业微信
微信支付
扫描小程序码分享
因为要给scrollView一个全屏的大小 然后又要监听事件 如果直接设为1334 会有一些莫名其妙的BUG 因为导航栏占用了64px,系统自己做了一个外部滑动好像是这样 但是导致监听事件紊乱,当滑到低于xx位置的时候回调无法触发。1334rpx-64px做法又不行 我有点感觉绝望
或者哪位大佬能知道 如何获取到位于导航栏和tabbar之间的确定的rpx数值
12 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
万分感谢
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
我认为,你应该改成
style="height: {{scrollViewContent}}px;"
data: {
indicatorDots: true,
。。。(省略n多信息)
scrollViewContent: 1000,
},
当然我知道我设置id准备使用H5的方法获取view的做法可能很煞笔
我想 我可能需要把问题重新描述一遍 了
<scroll-view style="height: {{scrollViewContent}};" id="1" scroll-y bindscroll="scroll" bindscrolltoupper="upper">
这是我的样式代码
onLoad: function (options)
{
var res = wx.getSystemInfoSync();
console.log(res.windowHeight);
这是我获取高度的代码
scrollViewContent: 1000px,
这是我js中的数据
我知道我没有将数据放进去 但是在第一步绑定的时候就出现了问题
如果你只是想设置scrollView高度为可用全屏的话
page{
height
:
100%
;
}
scroll-view{
对啊 或许 我表达的不够清晰
我并不知道 怎么能够设置那个view的高度
你的目的不是获取navigationBar到tabbar之间的距离吗?
wx.getSystemInfo({
success:
function
(res) {
console.log(res.model)
console.log(res.pixelRatio)
console.log(res.windowWidth)
console.log(res.windowHeight)
console.log(res.language)
console.log(res.version)
console.log(res.platform)
})
他返回的windowHeight就是这个距离,单位是px
虽然我很想展现得 我知道怎么做了 但是我到现在还是不知道 怎么做
_(:з」∠)_
https://mp.weixin.qq.com/debug/wxadoc/dev/api/systeminfo.html#wxgetsysteminfoobject
能给个demo地址吗 我连获取控件的办法都是没找到
正在加载...
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
万分感谢
我认为,你应该改成
style="height: {{scrollViewContent}}px;"
data: {
indicatorDots: true,
。。。(省略n多信息)
scrollViewContent: 1000,
},
当然我知道我设置id准备使用H5的方法获取view的做法可能很煞笔
我想 我可能需要把问题重新描述一遍 了
<scroll-view style="height: {{scrollViewContent}};" id="1" scroll-y bindscroll="scroll" bindscrolltoupper="upper">
这是我的样式代码
onLoad: function (options)
{
var res = wx.getSystemInfoSync();
console.log(res.windowHeight);
},
这是我获取高度的代码
data: {
indicatorDots: true,
。。。(省略n多信息)
scrollViewContent: 1000px,
},
这是我js中的数据
我知道我没有将数据放进去 但是在第一步绑定的时候就出现了问题
如果你只是想设置scrollView高度为可用全屏的话
page{
height
:
100%
;
}
scroll-view{
height
:
100%
;
}
对啊 或许 我表达的不够清晰
我并不知道 怎么能够设置那个view的高度
你的目的不是获取navigationBar到tabbar之间的距离吗?
wx.getSystemInfo({
success:
function
(res) {
console.log(res.model)
console.log(res.pixelRatio)
console.log(res.windowWidth)
console.log(res.windowHeight)
console.log(res.language)
console.log(res.version)
console.log(res.platform)
}
})
他返回的windowHeight就是这个距离,单位是px
虽然我很想展现得 我知道怎么做了 但是我到现在还是不知道 怎么做
_(:з」∠)_
https://mp.weixin.qq.com/debug/wxadoc/dev/api/systeminfo.html#wxgetsysteminfoobject
能给个demo地址吗 我连获取控件的办法都是没找到