is there any way to change component setting of Constraint: "Fixed Row Count", by script, and then assigning constraint count to 1?
Create a script, .eg test.cs, add/attach this script to the same game object as the GridLayoutGroup:
public class test : MonoBehaviour {
GridLayoutGroup glg;
void Start () {
glg = gameObject.GetComponent<GridLayoutGroup>();
Debug.Log(glg);
glg.constraint = GridLayoutGroup.Constraint.FixedRowCount; //**
glg.constraintCount = 1; //**
}
}
Run the game, you will see this is automatically set to 1.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.