UGUI Button取消键盘响应
简单粗暴的方式是改预制体的Navigation
如果是动态创建的button,那么走这个:
Navigation customNav = new Navigation(); var btn = GetComponent
当然,你最好封装成一个方法,方便调用:
void ChangeNavigationToNone(Selectable component) { Navigation customNav = new Navigation(); customNav.mode = Navigation.Mode.None; component.navigation = customNav; }