Unity UGUI 设置 left 、right、top、bottom
2018-02-27 14:40
344 查看
RectTransform transform = GetComponent<RectTransform>(); transform.offsetMin = new Vector2(0,42); transform.offsetMax=new Vector2(0,-62);
通过RectTransform 的属性offsetMin,offsetMax来实现;offsetMin 是vector2(left,bottom);
offsetMax 是vector2(right,top);//如果Anchors max=(1,1),right,top要传入负数;
相关文章推荐
- 设置position:absolute 后 top right bottom left 如何偏移
- Android控件设置——动态View的drawableLeft/ drawableRight/drawableTop/drawableBottom
- 动态设置Button的drawableLeft | Top |Right |Bottom
- 动态设置android:drawableLeft|Right|Top|Bottom
- 动态设置android:drawableLeft|Right|Top|Bottom
- 动态设置android:drawableLeft|Right|Top|Bottom
- 动态设置drawableTop,drawableLeft,drawableRight,drawableBottom
- 安卓在代码中设置TextView的drawableLeft、drawableRight、drawableTop、drawableBottom
- Android 设置 drawableLeft|Right|Top|Bottom
- 安卓在代码中设置TextView的drawableLeft、drawableRight、drawableTop、drawableBottom显示和隐藏
- android 动态设置android:drawableLeft|Right|Top|Bottom
- UGUI_Text_Gradient: GradientLeftToRight / GradientTopToBottom
- Android在代码中设置控件的drawableLeft,drawableRight,drawableTop,drawableBottom。
- Android动态设置android:drawableLeft|Right|Top|Bottom 并根据分辨率自适应
- 动态设置 android:drawableTop|Right|Left|Bottom
- Unity3d UGUI 自适应屏幕 代码修改Left,Top,Right,Bottom属性值
- 动态设置android:drawableLeft|Right|Top|Bottom
- 动态设置android:drawableLeft|Right|Top|Bottom
- 设置drawableTop、drawableLeft、drawableRight、drawableBottom图片大小
- Android在代码中设置控件的drawableLeft,drawableRight,drawableTop,drawableBottom