Ngui 左右滑动
来源:互联网 发布:北面和狼爪哪个好 知乎 编辑:程序博客网 时间:2024/06/05 14:16
实现效果图:
private UIScrollView fubenScrollView; private UIGrid fubenGrid;public void OnBtnRight()//右btn{if (fubenScrollView == null || fubenGrid == null)return;int curIndex = GetFubenScrollViewIndex();Vector3 targetPos = new Vector3(-(curIndex + 1) * fubenGrid.cellWidth, fubenScrollView.transform.localPosition.y, 0);CapterData chapterData;if (CapterManager.Instance.getCapterDataById(currentChapterId.ToString(), out chapterData)){List<int> fubenIds = chapterData.Commonfubens;if (targetPos.x < - ((fubenIds.Count - 4) * fubenGrid.cellWidth + 10)){return;}}SpringPanel.Begin(fubenScrollView.panel.cachedGameObject, targetPos, 6f);}public void OnBtnLeft()//左btn{if (fubenScrollView == null || fubenGrid == null)return;int curIndex = GetFubenScrollViewIndex();Vector3 targetPos = new Vector3(-(curIndex - 1) * fubenGrid.cellWidth, fubenScrollView.transform.localPosition.y, 0);if (targetPos.x > 10){return;}SpringPanel.Begin(fubenScrollView.panel.cachedGameObject, targetPos, 6f);} private int GetFubenScrollViewIndex(){if (fubenScrollView == null || fubenGrid == null)return 0;return Mathf.Abs(Mathf.RoundToInt(fubenScrollView.transform.localPosition.x / fubenGrid.cellWidth)); }
0 0
- Ngui 左右滑动
- 滑动事件左右滑动
- ngui一个滑动
- NGUI 背包滑动整合
- android 滑动效果---左右滑动
- android滑动---锯齿状左右滑动
- android 手势左右滑动
- ViewFlipper 左右滑动效果
- Android 左右滑动 控件
- 判断左右触摸滑动
- android中的左右滑动
- ViewFlipper 左右滑动效果
- viewpager 实现左右滑动
- android手势左右滑动
- android中的左右滑动
- android 实现左右滑动
- ViewFlipper + scrollView 左右滑动
- android 手势左右滑动
- 利用Oracle数据库发送邮件
- 安卓开发之异步消息处理机制
- error: stray '\343' in program 问题解决
- PE reading C13
- 类似于微信首页右上角弹出view
- Ngui 左右滑动
- 207. Course Schedule LeetCode
- 【bzoj1492】[NOI2007]货币兑换Cash 斜率优化+set+凸包
- GestureDetector使用详解
- 复制图像打水印
- 骑士游历算法
- ext2文件系统源代码之file.c
- Java的string类为什么是不可变的
- RatingBar自定义背景下面有直线