2
switch (attribute.inputType & EditorInfo.TYPE_MASK_CLASS) {
case EditorInfo.TYPE_CLASS_NUMBER:
case EditorInfo.TYPE_CLASS_DATETIME:
case EditorInfo.TYPE_CLASS_PHONE:
mCurKeyboard = mSymbolsKeyboard;
break;
case EditorInfo.TYPE_CLASS_TEXT:
mCurKeyboard = mQwertyKeyboard;
}
這是什麼意思?android - 用'&'切換兩個值
我的測試結果是:
attribute.inputType = 17
EditorInfo.TYPE_MASK_CLASS = 15
切換到case EditorInfo.TYPE_CLASS_TEXT
這是= 1
不錯的教程。好分享。 – LuxuryMode