天天看點

android studio如何建立selector,Android Studio建立selector的xml檔案的方法

對剛入手Android Studio軟體的小夥伴而言,建立selector的xml檔案可能還有點難度,那麼該怎麼辦呢?下面就是小編帶來的Android Studio建立selector的xml檔案的教程,有需要的朋友不要錯過哦。

方法一:該方法既能在Android模式下進行,也可以在project模式下進行

android studio如何建立selector,Android Studio建立selector的xml檔案的方法

右擊将建立的xml 檔案的module,選擇Android resource file

android studio如何建立selector,Android Studio建立selector的xml檔案的方法

在彈出的界面中,将Resource type 修改為Drawable

android studio如何建立selector,Android Studio建立selector的xml檔案的方法

方法二:但這個必須是在project模式下的

android studio如何建立selector,Android Studio建立selector的xml檔案的方法

找到需建立xml 的module 下的drawable檔案,在此目錄下右擊drawable,選擇Drawable resource file,具體路徑為app-->src-->res-->drawable,右擊操作順序為 New-->Drawable resource file

android studio如何建立selector,Android Studio建立selector的xml檔案的方法

在彈出的頁面直接建立即可。

android studio如何建立selector,Android Studio建立selector的xml檔案的方法

上文就講解了Android Studio建立selector的xml檔案的方法,希望有需要的朋友都來學習哦。