1.軟鍵盤隱藏問題
InputMethodManager im = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); im.hideSoftInputFromWindow(getCurrentFocus().getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
InputMethodManager im = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); if(getCurrentFocus!=null)im.hideSoftInputFromWindow(getCurrentFocus().getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
<activity Android:windowSoftInputMode="adjustResize">
2.merge標簽注意點
android.view.InflateException: Binary XML file line #2: <merge /> can be used only with a valid ViewGroup root and attachToRoot=true Caused by: android.view.InflateException: <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
3.LinearLayout注意點
4. 布局選擇
FrameLayout是最簡單的一種布局,所有安卓界面的根布局都是FrameLayout,加載速度最快。
LinearLayou布局與RelativeLayout布局的加載速度需要進一步深入的研究才能得出具體結論。
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作具有一定的參考學習價值,謝謝大家對VEVB武林網的支持。
新聞熱點
疑難解答