unity的LayoutGroup分为三种,
Horizontal Layout Group(水平布局):对象填充总个父物体,水平会填充
Vertical Layout Group(垂直布局):垂直(高度)会填充
Grid Layout Group (网格布局):以表格的形式布局,不会填充父物体
比如:垂直布局和水平布局效果
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAg8AAAJfCAIAAAB3yaICAAAgAElEQVR4nO3dR3RUZ7bo8W/2uqev71o9uXfQvm9y131v9NomGAx9e63X1yYIkEDknJNQFkHkHA0IEU0UUTmTFEACIRASIhhEBifAYMCYbLveoEpVp+qcOhLYXae+tf97/WZM9tJg/zklVZX6PwzDMGE2H3zwgdMrhMVER0cvX77c8p9C/yNS/5thGCbM5oMPPnB6hXCf0P+I1H8yDMOE2fzlL39xeoVwn9D/iNS/MQzDhNn8+c9/dnqFcJ/Q/4hUdExa9OQAazM7dHf98Y8AAAkyO3SPnrzWnuobk9Y3Ji3aa3Ja9OQ0agEAcrxDLbzczaAWACBHC7WIWRsdY6qFG7UAADmsaxGz1tgFagEA0vnVwj8Sxlqsa0YtAECizA7dg0XCshY+1AIA5Mjs0N0+FTa1iHB8ewBAaLSuFlPW+VALAJDn3WvRjFoAgBzUAgDQslbVot+UdIN1/agFAAjzHrXwyKIWACCGbS08v8+mFgAgnVUt/P9Wdgq1AADxmmthekOF4ffZql9sug+1AAB5MjtEWBYioBbr+8Wu92tGbHpWR2oBAFJkdogIFglzLfxQCwCQw6YW/ZoFq0UPx7cHAIRGQC36WVH9Y9d7UQsAECizQ4RlIYLWwotaAIAcWdQCANCilmqR3m9Kuuoft8EftQAAWaxqEfg+PHMtNvSP25DVsafj2wMAQqO5FhZv1qYWAACPrA4R9qmgFgAA21o0v2ubWgCAdIG1iLWgBsRtbEYtAECirA4RloXwr0X8Rg9fNjZmUwsAECOr4zvVwiD7E2oBAFIEq0X/2HTv+/CoBQBIF1ALYySoBQDAI6tjhGUhAmqxaUD8JmoBAGJldewRtBNxHt5a+KEWACBHYC3iLASrRS/HtwcAhEZWxx6WhWi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FqIU2qAW1kIlaaIlaUAuZqAW1ALXQBrWgFjJRCy1RC2ohE7WgFqAW2qAW1EImaqElakEtZKIW1ALUQhvUglrIRC20RC2ohUzUglqAWmiDWlALmaiFlqgFtZCJWlALUAttUAtqIRO10BK1oBYyUQtqAWqhDWpBLWSiFlqiFtRCJmpBLUAttEEtqIVM1EJL1IJayEQtqAWohTaoBbWQiVpoiVpQC5moBbUAtdAGtaAWMlELLVELaiETtaAWoBbaoBbUQiZqoSVqQS1kohbUAtRCG9SCWshELbRELaiFTNSCWoBaaINaUAuZqIWWqAW1kIlaUAtQC21QC2ohE7XQErWgFjJRC2oBaqENakEtZKIWWqIW1EImakEtQC20QS2ohUzUQkvUglrIRC2oBaiFNqgFtZCJWmiJWlALmagFtQC10Aa1oBYyUQstUQtqIRO1oBagFtqgFtRCJmqhJWpBLWSiFtQC1EIb1IJayEQttEQtqIVM1IJagFpog1pQC5mohZaoBbWQiVpQC1ALbVALaiETtdAStaAWMlELagFqoQ1qQS1kohZaohbUQiZqQS1ALbRBLaiFTNRCS9SCWshELagFqIU2qAW1kIlaaIlaUAuZqAW1ALXQBrWgFjJRCy1RC2ohE7WgFqAW2qAW1EImaqElakEtZKIW1ALUQhvUglrIRC20RC2ohUzUglqAWmiDWlALmaiFlqgFtZCJWlALUAttUAtqIRO10BK1oBYyUQtqAWqhDWpBLWSiFlqiFtRCJmpBLUAttEEtqIVM1EJL1IJayEQtqAWohTaoBbWQiVpoiVpQC5moBbUAtdAGtaAWMlELLVELaiETtaAWoBbaoBbUQiZqoSVqQS1kohbUAtRCG9SCWsjUqloMGxBt9kWbj5r+5V/giKSx//Gno5/AEf86dtr/+lMJHPGvQzb+KXMGHNF+3njLFhipvzAMwzBMS6P+g2EYhmFaGmrBMAzDtDzUgmEYhml5qAXDMAzT8vx/qdl/my4yLk0AAAAASUVORK5CYII=" alt="" />
Grid Layout Group
如果单纯的时候用滑动效果可以使用Scroll Rect组件即可。但使用布局就要使用布局控件
Grid Layout Group是网格布局,先看看一个效果
其实滑动依然是用的Scroll Rect。这个就不说了。这里主要说布局。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARMAAADbCAIAAADBB+KCAAAgAElEQVR4nO2dfUwjaZ7fN0qiKIqi6O7+SPaPjfYyo2iUnVHP3FSD341tbMAYMIa2wTZgm5fmHdO8TjNAA24b0zRDg2loaLB5s/G7cT/RjqK73bndvsvpNrposkqkiy6by0bZUatnd1Z3p1VGyir548mUCle5wAXYZfr3Uf/x+OfnrZ6qL1Wurl99vyUSiQQAAOSCSCT6VmNjYzMAALnQ2Nj4LTjnAECuiESi3JTzzjvvvH1h3nnnneubOgAUkJyV8/bbb//VhXn77bevb+oAQOd3f/dfiGvvfvdW7b8RNb0ntX5QZv9Qbb+ttku1ncq6XlXt3QqN6UoG4qic754Fn2EygqAcIM/8y9//QKy7O7kY+OXf/O//m4Vq82i25kKh0O12u91uoVB47ljclZNxbsk4F9GVU11d7XQ6Vyg8/gZ/IPD111+/fPmytLT04jMBgAz+wT/99o8+/6Jl1DfoOnRMbk48jjwN/eDfvvwvn//313/9+m++/j+//e1vf6tsGsloJRQKDQaD2+2WSCSffvrpp59+KpFI3G63wWBgkdCllEM9t1DPRXTllJaWOhyOsbGxu3fv2u12x1k+//zzr7/+enNzu6SkhMN6sYAQQghdbZ83lfb2doTQkydPCjWBtbU1hFB7ezvnHv7eP/q9P/3LX97pexT57K8W9j5b2Pts+un3R1cSXbO7ltFVp+v5l19+qTAxKMfj8XxKw+PxXFQ5Vqu1hwmr1Uo24Kac27dvY82Yz2KxWA6Pjn7zm9/84Q9/ODIyQhAEOZBcLh8bG/P7/fF4PBqNut3uwcHBbJuRTSG5xq8VlkFz2tjrQC6Xx2KxZDJZXl6OI2VlZXNzc6FQKJVK+Xy+8fHxnDq8yApn1FGr1alUKhqNymSyXOeP+fv/5Nvf/8n/1N91R37wXw++/59e/ervXv3q7/zoP7oDP14I/Mg6+vT169d05YhEIqVSidUyMDAwMDCAy0qlkuWkckY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ChWxxKmtra1NTU4wjBoPBhoYGXG5sbAwGg/R+GMvUoMFgCIfDF++Q+vHo6MhoNNInlq0+NkJk3JZioa2tjV/KsVgsVUXO2tra0NAQNeJ0OtfW1qqqqtxud1dXl1arxbcEEEK4QrY4FavVGo/HsddxTU1NR0fH5uYm/mpmZubjjz+uqampqan5+OOPZ2ZmcJzaD2MZIWSz2XQ6XV1d3dTUFJ7kBTukfrx///7Y2Jher9fpdK2trWQ/2eofHx8PDQ1ptdpzF5O3WM6aFhZeOSaTqaKY0ev1sVisurqaGtTpdPF4XK/X19TUrKysJBKJo6Oj8fFxhBCukC2eQUtLy8bGRiKROD09DQQCU1NTOK7Val0uVyQSiUQiLpdLq9XiOLUfxjJCaHNzM5VKhUKh+/fv63S6i3dI/VhZWdnb23twcJBKpba2toaGhtjrd3Z2Hh0dpdPpSCRyzoLyFZPJxC/lNDY2Ftrm5A0C0WxDgQvS2NjIL+XU19ergHyBECr0FIqVDLvPwiunpqZGAQC8p6amhl/K0Wq1cgDgPRlGuYVXjkajkcvlMgDgMXK5XKPR8Es5IpFIoVBIpVIJAPASqVSqUChEIhGPlIPtlAUCQVlZWaF/AQIAM2VlZQKBIMNiusDKATtlgP8wWkwXWDkCsFMGigG6xTRn4H1rAMAFUA4AcAGUAwBcAOUAABdEItH/A811NOorSj6aAAAAAElFTkSuQmCC" alt="" />
Spacing 表示 cell之间的距离。
Cell表示格子的宽度和和高度
Start Axis 表示布局方式,有横向和纵向
Child Alignment 表示对齐方式。
注意Layout Group节点下面的所有cell节点都是不能修改Rect Transform的。因为cell可能下面会放很多图片,这样我们会用个空的gameObject来当父节点。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPsAAACRCAIAAACKf1nNAAAdqUlEQVR4nO2da0wjW57YO0qiKIqiaHc/JPPhRru5m9yrHrqhmx5ctqvKVX5g4ycYY4PNwy/84mWMMdy53Q0NNNDdQHP9ABqDoaExDdhA07UaaZWdzN7bSlbZ1kaTUSJtdJNsJsqO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MQEBEEjIyMej4c0nrrBvGO+cAgEAjDnKIZhbrc7iy5lu7oGEF0oFLpcLgzDaHtzXA2lmFSW8TAM7+zsyOXyjY0NoVDIajzzjvmCgmFYd3e31WrNpAuYrq2c1xrQ6XR9fX3gwzNLEwCZZsovGpVlPARBoVBoc3MzGAxCp0WnbVDvmC8oGIbZbDaHw0H+3YTkqhgPQVAoFGKNc8ZnpxjGg5uKwf9lsxgPFeULHIFA4PF4MAzDcdzr9bKOakA/lfnqGpzxF+P/A/0+2qEg4943AAAAAElFTkSuQmCC" alt="" />
但你仔细看。会发现。这个不是整块滑动的。比如手机屏幕左右滑动,是滑动区域判断的。没有划过来的时候。会退回去。像这样
这里可以根据Scroll Rect组件的normalizedPosition属性来判断。这是一个Vector2坐标。是滑动中XY的值
horizontalNormalizedPosition:水平的值
verticalNormalizedPosition:垂直的值
需要在拖动结束后判断。需要继承
IBeginDragHandler,IEndDragHandler。引用命名空间:using UnityEngine.EventSystems;
具体代码:
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.UI; public class newScroll : MonoBehaviour, IBeginDragHandler, IEndDragHandler
{
ScrollRect rect; //页面:0,1,2 索引从0开始
//每夜占的比列:0/2=0 1/2=0.5 2/2=1
float[] page = { , 0.5f, }; //滑动速度
public float smooting = ; //滑动的起始坐标
float targethorizontal = ; //是否拖拽结束
bool isDrag = false; // Use this for initialization
void Start()
{
rect = transform.GetComponent<ScrollRect>();
} // Update is called once per frame
void Update()
{
//如果不判断。当在拖拽的时候要也会执行插值,所以会出现闪烁的效果
//这里只要在拖动结束的时候。在进行插值
if (!isDrag)
{
rect.horizontalNormalizedPosition = Mathf.Lerp(rect.horizontalNormalizedPosition, targethorizontal, Time.deltaTime * smooting);
}
} /// <summary>
/// 拖动开始
/// </summary>
/// <param name="eventData"></param>
public void OnBeginDrag(PointerEventData eventData)
{
isDrag = true;
} /// <summary>
/// 拖拽结束
/// </summary>
/// <param name="eventData"></param>
public void OnEndDrag(PointerEventData eventData)
{
isDrag = false; // //拖动停止滑动的坐标
// Vector2 f = rect.normalizedPosition;
// //水平 开始值是0 结尾值是1 [0,1]
// float h = rect.horizontalNormalizedPosition;
// //垂直
// float v = rect.verticalNormalizedPosition; float posX = rect.horizontalNormalizedPosition;
int index = ;
//假设离第一位最近
float offset = Mathf.Abs(page[index] - posX);
for (int i = ; i < page.Length; i++)
{
float temp = Mathf.Abs(page[i] - posX);
if (temp < offset)
{
index = i; //保存当前的偏移量
//如果到最后一页。反翻页。所以要保存该值,如果不保存。你试试效果就知道
offset = temp;
}
} /*
因为这样效果不好。没有滑动效果。比较死板。所以改为插值
*/
//rect.horizontalNormalizedPosition = page[index]; targethorizontal = page[index];
}
}
像这种布局。内容是动态添加的。所以内容的多少是不确定的。很多时候是用u3d自带的ContentSizeFitter。这个组件可以自动计算宽度
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARsAAAFtCAIAAAC4NFmqAAAgAElEQVR4nO29+Vcj2Znnjd1u+51557jP6/KZcldCkpVJkhAgKRQKLaAFSSC0AEILq5Itk2QViF1CoJRAgHaJa6ftKmdV2T32KVdXe9rjdo+nXTVV5T5Od9VUmf9p3h+uMxwZG5LQCvdzOJyrG3eP+Coiru5zn4b29va2trYHra0tLS0tLS1vvPHGm2+++eabb77xxhtisVhUCIeHh+Pj4wRBSKXS/v7+3d3dgrIDAApKX3JWVlamp6dh+OHDh8vLy/Sjra2tOI6TJEmSJHgJWUFwHG9tbaU3SSqVhkIhrVYrEom0Wm0wGMRxvKbazNlsBuPj44uLizXVbHabv/e979lsNr1er9PptFptd3e3SqVSKBQymUwqlUKldHR0EATRUEJFpVIplUrFjicIYnl5OR6Ph8Nhs9kMI09PT3O53NnZmcPhgDGUouRy+dbWVjqdPjo66u3tLagNVwHH8YODAzhe+/v7AlcndbKre5pFL4UklUr9fn9XVxfjaNXbzNdsCrPZvLOzw7jSqt7sWlHU+Ph4LBZbX1/3eDxqtZqKX1lZ8Xg8BEF0dXVtbm7Ss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hf+vPzc61Wy9mXemFwcLBYRRG4FBdLxGKRqKOjo729vbW1taWl5e7du83NzbebSv0eZbVau+ucvb29iYkJeozH49nd3e3u7vZ6vS6XS61W9/b2Li0tAQBgAr54OjabLZ1Oz83NGQwGrVbrcDiCwSA8tLCwMD8/r9VqtVrt/Pz8kydPYDy9HM4wAAB+hfX09Dx+/Hhvby//AukfHz16ND09rdfrNRrNwMAAVQ5f+tPT04mJCbVafelg1ixWq7UoRREEIcWluEQsFolfVdSbd+8037nddLuxtPeo/v7+rnpGr9enUimNRkOP1Gq16XRar9frdLqtra10On1ycjIzMwMAgAn44hkMDAwEAoFMJpPL5Y6Ojubn52G8Wq1eWVmB83grKytqtRrG08vhDAMAgsFgNpuNxWKPHz/WarX5F0j/2N3dPTo6Go1Gs9lsMBicnJwUTu90Ok9OTnK5XCKREB7PmqW/v7/opz6pVCp5ueaIfo+603yn9HN9vb29SkSlAABUuwn1Sm9vb9GK+ss9ikNRzbdv3y7xXJ/BYFAgKgUAoNpNqFcMBkPR71FSHKfWxba1tTHeo0qsKJ1ORyIQNY9Op7vSPUoiFou57lFNtxtvNf7/yZspKCo2GXoAAAAASUVORK5CYII=" alt="" />
那么问题来了。当总数不是页数的倍数,那么horizontalNormalizedPosition是不正确的。比如:有2页。一页5条
当只有6条。是不是也是2页呢?。
所以又得必须动态计算了。
这里写了一个适用于其他场合的类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI; class UIScrollItemTips : MonoBehaviour, IBeginDragHandler, IEndDragHandler
{
//页面:0,1,2 索引从0开始
//每夜占的比列:0/2=0 1/2=0.5 2/2=1
public List<float> pageArray; //public List<float> PageArray
//{
// // get { return pageArray; }
// set { pageArray = value; }
//}
private List<Toggle> toggleArray; public List<Toggle> ToggleArray
{
//get { return toggleArray; }
set { toggleArray = value; }
}
public int pageCount;//多少页 public int pageIndex = ;//:当前页码
private ScrollRect rect;
//滑动速度
public float smooting; public float Smooting
{
get { return smooting; }
set { smooting = value; }
} private int pageSize; /// <summary>
/// 一页显示多少条
/// </summary>
public int setPageSize
{
get { return pageSize; }
set { pageSize = value; }
} private int sumRecord; /// <summary>
/// 总记录数
/// </summary>
public int setSumRecord
{
get { return sumRecord; }
set { sumRecord = value; }
} private List<GameObject> pageList = new List<GameObject>(); //滑动的起始坐标
public float targethorizontal = ; //是否拖拽结束
public bool isDrag = false; public GameObject root; private int updateInfo; public int UpdateInfo
{
//get { return updateInof; }
set { Init(); }
} //private static UIScrollItem instance;
//public static UIScrollItem Instance
//{
// get { return instance; }
// //set { ObjectPools.instance = value; }
//} void Init()
{
UnInit();
//pageSize = 8;
//setSumRecord = 54;
smooting = ;
rect = transform.GetComponent<ScrollRect>();
pageArray = new List<float>();
toggleArray = new List<Toggle>();
targethorizontal = ;
rect.horizontalNormalizedPosition = ;
//instance = this; //单列 pageCount = Convert.ToInt32(Math.Ceiling((double)sumRecord / pageSize)); //sumRecord为总记录数 //Debug.LogError(pageCount); //求出每页的临界角,页索引从0开始
int num = pageCount - ;
if (num == ) num = ;
for (int i = ; i < pageCount; i++)
{
//Debug.LogError(i + "/" + num + "==" + (float)i / (float)num);
pageArray.Add((float)i / (float)num);
} if (root != null)
{
ToggleGroup group = root.GetComponent<ToggleGroup>(); for (int i = ; i < pageCount; i++)
{
//获取页码预设体
GameObject pageItem = U3DResources.SpawnUI("Item_New");
pageList.Add(pageItem);
pageItem.transform.SetParent(root.transform);
pageItem.transform.localScale = new Vector3(, , );
pageItem.transform.localRotation = new Quaternion();
pageItem.transform.localPosition = Vector3.one; Toggle toogle = pageItem.transform.Find("page").GetComponent<Toggle>();
toogle.group = group;
toggleArray.Add(toogle);
} } //Debug.LogError(pageSize); //rect.horizontalNormalizedPosition = 0; //不管怎样默认都是显示最后一页,同理,页码页码也是。已在生成页码时处理
//初始化不需要显示滑动效果。直接赋值即可
//targethorizontal = pageArray[pageArray.Count - 1];
//rect.horizontalNormalizedPosition = pageArray[pageArray.Count - 1]; foreach (var item in toggleArray)
{
item.isOn = false;
} if (toggleArray.Count > )
{
//默认第一个选中
toggleArray[].isOn = true; }
} void Awake()
{
}
void Start()
{
//Init();
//rect.horizontalNormalizedPosition = 0;
} void Update()
{
//如果不判断。当在拖拽的时候要也会执行插值,所以会出现闪烁的效果
////这里只要在拖动结束的时候。在进行插值
if (!isDrag)
{
rect.horizontalNormalizedPosition = Mathf.Lerp(rect.horizontalNormalizedPosition, targethorizontal, Time.deltaTime * smooting); //rect.horizontalNormalizedPosition = targethorizontal;
}
}
/// <summary>
/// 拖动开始
/// </summary>
/// <param name="eventData"></param>
public void OnBeginDrag(PointerEventData eventData)
{
isDrag = true;
} /// <summary>
/// 拖拽结束
/// </summary>
/// <param name="eventData"></param>
public void OnEndDrag(PointerEventData eventData)
{
isDrag = false; float posX = rect.horizontalNormalizedPosition;
int index = ;
//假设离第一位最近
float offset = Mathf.Abs(pageArray[index] - posX);
for (int i = ; i < pageArray.Count; i++)
{
float temp = Mathf.Abs(pageArray[i] - posX);
if (temp < offset)
{
index = i;
//保存当前的偏移量
offset = temp;
}
}
try
{
targethorizontal = pageArray[index];
//说明页码大于1 toggle有值
if (pageCount > && toggleArray.Count > )
toggleArray[index].isOn = true;
}
catch (Exception)
{
return;
}
} void UnInit()
{
foreach (var item in pageList)
{
U3DResources.Despawn(item);
}
}
}
调用
itemTips.setSumRecord = nows;
itemTips.setPageSize = ;
mItemGrid.GetComponent<ContentSizeFitter>().enabled = false; //总页数
int pageCount = Convert.ToInt32(Math.Ceiling((double)nows / itemTips.setPageSize)); //sumRecord为总记录数 int resultCount = nows; if (nows % itemTips.setPageSize != )
{
//求差
int poor = pageCount * itemTips.setPageSize - nows;
//加上差数。凑整
resultCount = nows + poor;
}
else
{
//可以启用自动计算宽度
//mItemGrid.GetComponent<ContentSizeFitter>().enabled = true;
} //Debug.LogError(nows);
//Debug.LogError(resultCount); GridLayoutGroup group = mItemGrid.GetComponent<GridLayoutGroup>();
float cellSize = group.cellSize.x; //一个格子的宽度
float spacing = group.spacing.x; //格子的间距 //总宽度
float totalWidth = cellSize * resultCount + (resultCount - ) * spacing;
//Debug.LogError(totalWidth); RectTransform rectWidth = mItemGrid.GetComponent<RectTransform>();
Vector2 targetVec = new Vector2(totalWidth, rectWidth.sizeDelta.y);
rectWidth.sizeDelta = targetVec;
itemTips是UIScrollItemTips变量
ScrollRect滑动组件。怎么可以定位到哪个地方呢。即滑动到指定位置;
ScrollRect有个属性normalizedPosition,是Vector2类型的。
如果是垂直滑动;那么范围是1-0
比如到初始位置
GetComponent<ScrollRect>().normalizedPosition = new Vector2(0, 1);
滑动到最后一页
GetComponent<ScrollRect>().normalizedPosition = new Vector2(0, 0);