Android 约束的目的';setDesignInformation方法
Android 约束的目的';setDesignInformation方法,android,android-constraintlayout,Android,Android Constraintlayout,ConstraintLayout类中包含的get/setDesignInformation方法的假设用途是什么 第一个参数type,必须等于0,以保持提供的值,而第二个参数name,具有接受字符/后提供的字符串(如果有)的逻辑 源代码由中的setChildrenConstraints()调用,一个绑定到isInEditMode,另一个绑定到DEBUG标志 isInEditMode块有以下注释: // In design mode, let's make sure we keep
ConstraintLayout
类中包含的get
/setDesignInformation
方法的假设用途是什么
第一个参数type
,必须等于0
,以保持提供的值,而第二个参数name
,具有接受字符/
后提供的字符串(如果有)的逻辑
源代码由中的
setChildrenConstraints()
调用,一个绑定到isInEditMode
,另一个绑定到DEBUG
标志
isInEditMode
块有以下注释:
// In design mode, let's make sure we keep track of the ids; in Studio, a build step
// might not have been done yet, so asking the system for ids can break. So to be safe,
// we save the current ids, which helpers can ask for.
因此,这可能有助于Android Studio设计器,也可能有助于新的小部件预览选项