为了账号安全,请及时绑定邮箱和手机立即绑定

请问关于mvvm在xml怎么拿到其他控件的值?

请问关于mvvm在xml怎么拿到其他控件的值?

慕妹3146593 2019-08-16 15:10:36
mvvm在xml怎么拿到其他控件的值
查看完整描述

3 回答

?
智慧大石

TA贡献1946条经验 获得超3个赞

int defStyleRes) {
Properties properties = getProperties(context, attrs, defStyleAttr, defStyleRes);
setOrientation(properties.orientation);
....
}

public static Properties getProperties(Context context, AttributeSet attrs,
int defStyleAttr, int defStyleRes) {
Properties properties = new Properties();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecyclerView,
defStyleAttr, defStyleRes);
properties.orientation = a.getInt(R.styleable.RecyclerView_android_orientation, VERTICAL);
properties.spanCount = a.getInt(R.styleable.RecyclerView_spanCount, 1);
properties.reverseLayout = a.getBoolean(R.styleable.RecyclerView_reverseLayout, false);
properties.stackFromEnd = a.getBoolean(R.styleable.RecyclerView_stackFromEnd, false);
a.recycle();
return properties;
}



查看完整回答
反对 回复 2019-08-24
?
繁星coding

TA贡献1797条经验 获得超4个赞

比如你在VM定义一个command,然后在view层使用了这个command,那么这个command的parameter就可以指向view层里的控件啊。控件作为parameter传进VM层的command里做逻辑处理。



查看完整回答
反对 回复 2019-08-24
  • 3 回答
  • 0 关注
  • 638 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信