CreateDropDown() public static method

public static CreateDropDown ( UIComponent parent ) : UIDropDown
parent UIComponent
return UIDropDown
示例#1
0
        public static UIDropDown CreateDropDownWithLabel(out UILabel label, UIComponent parent, string labelText, float width)
        {
            var labelWidth = Mathf.Round(width * LABEL_RELATIVE_WIDTH);

            var dropDown = UIUtil.CreateDropDown(parent);

            dropDown.relativePosition = new Vector3(labelWidth + COLUMN_PADDING, 0);
            dropDown.width            = width - labelWidth - COLUMN_PADDING;

            label = AddLabel(parent, labelText, labelWidth, dropDown.height);

            return(dropDown);
        }
示例#2
0
        public static UIDropDown CreateDropDownTextFieldWithLabel(out UILabel label, out UITextField textField, UIComponent parent, string labelText, float width)
        {
            var labelWidth     = Mathf.Round(width * LABEL_RELATIVE_WIDTH);
            var textFieldWidth = 35f;
            var dropDownWidth  = width - labelWidth - textFieldWidth - 2 * COLUMN_PADDING;


            var dropDown = UIUtil.CreateDropDown(parent);

            dropDown.relativePosition = new Vector3(labelWidth + COLUMN_PADDING, 0);
            dropDown.width            = dropDownWidth;

            textField = UIUtil.CreateTextField(parent);
            textField.relativePosition = new Vector3(labelWidth + dropDownWidth + 2 * COLUMN_PADDING, 0);
            textField.width            = textFieldWidth;
            textField.height           = dropDown.height;

            label = AddLabel(parent, labelText, labelWidth, dropDown.height);

            return(dropDown);
        }