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;
}

TA貢獻1797條經驗 獲得超4個贊
比如你在VM定義一個command,然后在view層使用了這個command,那么這個command的parameter就可以指向view層里的控件啊??丶鳛閜arameter傳進VM層的command里做邏輯處理。
- 3 回答
- 0 關注
- 729 瀏覽
添加回答
舉報