???????????layoutInflater.inflate(R.layout.main?? null??false)?????????????R.layout.main???id?????????????????????????????????μ??????洢??sd???У??????????????????????????LayoutInflater??api??????????inflate(XmlPullParser parser?? ViewGroup root??boolean attachToRoot)?????????????????·???????????xmlPullParser:
????public XmlPullParser getXmlPullParser(String resource) {
????XmlPullParser parser = Xml.newPullParser();
????try {
????// InputStream is=mContext.getAssets().open("transfer_main.xml");
????FileInputStream is = new FileInputStream(resource);
????parser.setInput(is?? "utf-8");
????} catch (Exception e) {
????e.printStackTrace();
????}
????return parser;
????}
???????????????????????????????????????????????demo???????????????????????????????????
????????????????????????????????????????res/layout/xxx.xml??????????????????id?????????е???????????????????id???text??????drawble????????????R????????????????????????????????????????????????????????????о???apk???????????????????????????????????id????????????????View???????????
????protected View onCreateView(String name?? AttributeSet attrs)
????throws ClassNotFoundException {
????// return createView(name?? "android.view."?? attrs);
????return createView(name?? "com.xxx.xxxx.viewanalysis.view.VA"?? attrs);  //????com.xx.view.VATextView ??????????view ?????TextView
????}
?????????е????????д????????TextView???????????????????????????TextView??????????????????????????????????????????巽????????????????View????????????????????????view?????????????????????????????????????????9???????Button??GridView??RelativeLayout????????ж????view???????????У????±???????ClassNotFoundException????
????VAButton??????
????public class VAButton extends android.widget.Button {
????public VAButton(Context context?? AttributeSet attrs) {
????super(context);
????setAttributeSet(attrs);
????}
????@SuppressWarnings("deprecation")
????public void setAttributeSet(AttributeSet attrs) {
????HashMap<String?? ParamValue> map = YDResource.getInstance().getViewMap();
????int count = attrs.getAttributeCount();
????for (int i = 0; i < count; i++) {
????ParamValue key = map.get(attrs.getAttributeName(i));
????if (key == null) {
????continue;
????}
????switch (key) {
????case id:
????this.setTag(attrs.getAttributeValue(i));
????break;
????case text:
????String value = YDResource.getInstance().getString(
????attrs.getAttributeValue(i));
????this.setText(value);
????break;
????//case... 
????default:
????break;
????}
????}
????}
????Ps: view id????????????????????????????????demo??
??????????????????????????????????????????????????????
????demoЧ?????


????????е?Ч?????

??????????????demo?е???????

????????????????????YDLayoutInflater??ParamValue?????????9???????view??
????YDLayoutInflater????????LayoutInflater??????????Щ????????????????????????????????
??????????????????
?????????????????·???????????????У?Ч??????????????Щ????淶??????????????????????????????????????????????£?????д????и??????????????????