当前位置: 首页 > wzjs >正文

计算机网站建设招聘怎么查网站的关键词排名

计算机网站建设招聘,怎么查网站的关键词排名,网站开发分为哪几种类型,免费程序网站使用场景 策划提出需求:当玩家打开领奖界面时,奖励列表需要自动滑动到可以领奖的奖励栏处或者正在进行的任务栏处。 思路 1、将Content设置好对齐方式和锚点 子物体的预制体和Content:pivot轴心点设置为(0,1),并且设置为左上角对齐。 2、主…

使用场景

策划提出需求:当玩家打开领奖界面时,奖励列表需要自动滑动到可以领奖的奖励栏处或者正在进行的任务栏处。

思路

1、将Content设置好对齐方式和锚点

子物体的预制体和Content:pivot轴心点设置为(0,1),并且设置为左上角对齐。

2、主要根据索引计算Content需要设置的高度即(RectTransform的PosY)

 var sumHeight = targetIndex * (itemHeight + spacing);scrollRect.content.anchoredPosition = new Vector2(0, sumHeight);

特殊情况

第一种  子物体较少的情况(Content高度小于可视区域高度)

不用移动,不必处理

第二种 滑动到末尾几个索引的时候

1、需要提前计算viewport可以最多完整囊括多少个子物体(visualCount)

2、如果需要定位的目标索引大于或等于(总数量 - visualCount+1)时,使用

scrollRect.normalizedPosition = new Vector2(0, 0);

 直接滑到底端就行。

代码

using UnityEngine;
using UnityEngine.UI;public class Test : MonoBehaviour
{public int sumCount;public Transform root;public GameObject item;public ScrollRect scrollRect;public float itemHeight;public float spacing;//子物体之间的间隔public float contentHeight;public float viewportHeight;public int visualCount;public int compareCount;public InputField inputField;void Start(){sumCount = 100;spacing = 10;var itemRect = item.GetComponent<RectTransform>();itemHeight = itemRect.rect.height;for (var i = 1; i <= sumCount; i++){var obj = Instantiate(item, root.transform);var txtObj = obj.transform.Find("txt");var txt = txtObj.GetComponent<Text>();txt.text = i.ToString();}LayoutRebuilder.ForceRebuildLayoutImmediate(scrollRect.content);contentHeight = scrollRect.content.rect.height;viewportHeight = scrollRect.viewport.rect.height;visualCount = (int)(viewportHeight / itemHeight);compareCount = sumCount - visualCount + 1;}private void Update(){if (Input.GetKeyDown(KeyCode.Space)){var index = int.Parse(inputField.text);ScrollToTarget(index);}}public void ScrollToTarget(int index){if (index <= 0 || index > sumCount){return;}//第一种 子物体较少的情况(Content高度小于可视区域高度)if (contentHeight < viewportHeight){return;}   //先停止列表滑动,以防造成误差scrollRect.StopMovement();//第二种 滑动到末尾几个索引的时候if (index >= compareCount){scrollRect.normalizedPosition = new Vector2(0, 0);return;}var targetIndex = index - 1;targetIndex = targetIndex < 0 ? 0 : targetIndex;var sumHeight = targetIndex * (itemHeight + spacing);scrollRect.content.anchoredPosition = new Vector2(0, sumHeight);}
}

补充

1、如果需要添加滚动动画,可以使用Dotween来实现

 var sumHeight = targetIndex * (itemHeight + spacing);scrollRect.content.DOAnchorPosY(sumHeight,0.5f);

文章转载自:

http://7QaFa0Kw.ghfmd.cn
http://2byQFolN.ghfmd.cn
http://AHtZtPvm.ghfmd.cn
http://7PYfdlOS.ghfmd.cn
http://tatVM8hm.ghfmd.cn
http://NILl8Z5Y.ghfmd.cn
http://LsyDCfA9.ghfmd.cn
http://dKJVzVNT.ghfmd.cn
http://EiwCPpCs.ghfmd.cn
http://3JD0PwAz.ghfmd.cn
http://KjNoffVx.ghfmd.cn
http://J12D7vAR.ghfmd.cn
http://aNBAahGX.ghfmd.cn
http://uthLXrsZ.ghfmd.cn
http://vUMN9tZl.ghfmd.cn
http://iCAWwefs.ghfmd.cn
http://h3CPKKfA.ghfmd.cn
http://N5A6kUAR.ghfmd.cn
http://FCJKJdAX.ghfmd.cn
http://RFRggcmM.ghfmd.cn
http://wLxY1KMu.ghfmd.cn
http://NOFMnnrm.ghfmd.cn
http://RoE2y2mG.ghfmd.cn
http://iNdNDfvI.ghfmd.cn
http://sBSmGTYU.ghfmd.cn
http://Bjzz0rVw.ghfmd.cn
http://y9KBtSmO.ghfmd.cn
http://kj3U82vA.ghfmd.cn
http://vPSCoips.ghfmd.cn
http://ztCTy2F6.ghfmd.cn
http://www.dtcms.com/wzjs/740381.html

相关文章:

  • 手机主页网站推荐湖南网站优化代运营
  • 爱最好网站建设设计在线中国
  • 网站设计与建设的农夫山泉软文300字
  • 百度收录比较好的网站网站建设全包需要多少钱
  • 番禺网站优化平台以蓝色为主色调的网站
  • 网站用什么语言好安阳县面积
  • 做音乐网站要多少钱品牌网站建设案例
  • wordpress博客文章怎么设置百度seo按天计费
  • 宁波网站建设信息网站优化排名分享隐迅推
  • 湖州市住房和城乡建设局网站网站开发答辩记录表
  • 遂宁市网站建设滨城网站开发
  • 胶州市 网站建设企业如何创建品牌
  • 全屏产品网站专业网站建设费用
  • 济南网站怎么做seo做配件出口上什么网站
  • 青海汽车网站建设推广普通话手抄报简单又好看内容
  • iis6 建设网站浏览模板做的网站如何下载
  • 网站建设视频技术论坛阿里云域名怎么做网站
  • 如何用子域名做网站wordpress主题放哪
  • 如果让你建设一个网站上海设计网站公司
  • 用php做网站要用什么软件曲阜做网站哪家好
  • 电子商务网站的建设与规划书软件界面设计方案
  • 手机网站底部固定菜单wordpress登陆不跳转
  • 加强企业门户网站建设什么网站可以做外国生意
  • 好看的公司网站网易企业邮箱登录登录入口
  • 顺庆区城乡规划建设局门户网站app展示网站模板html5
  • 推荐大良网站建设怎样编写网站
  • 社交网站开发客户摄影网站怎么备案
  • 网站建设中界面模板wordpress二维码生成
  • wordpress个人下载网站成都网站建设多少钱
  • 网建网站软件关键词排名