Android Studio의 "res"폴더로 이미지를 가져 오거나 복사하는 방법은 무엇입니까?
모든 이미지를 res/drawable-xxx
폴더에 직접 저장할 수 있습니다 .
하지만 어떻게 import/copy
내 프로젝트로 이미지를 만들 수 Android Studio
있습니까?
Finder
(MacOS) 에서 이미지를 드래그하면 파일이 res
폴더 로만 이동 합니다.
시 context-menu
에는이 Import...
세 이하 New...
도하지 않습니다.
창에서 이미지로 이동 한 다음 ctrl + c를 누르거나 마우스 오른쪽 버튼을 클릭하고 복사
귀하의 res 폴더로 이동하여 폴더 중 하나 (예 : MDPI, HDPI ..)를 선택하고 ctrl + v를 누르거나 마우스 오른쪽 버튼으로 클릭하고 붙여 넣기
설정> 플러그인> 저장소 찾아보기> Serach Android Drawable Import로 이동
이 플러그인은 4 가지 주요 기능으로 구성됩니다.
- AndroidIcons 드로어 블 가져 오기
- 머티리얼 아이콘 드로어 블 가져 오기
- 스케일 드 드로어 블
- 다중 소스 그리기 가능
편집 : Android Studios 1.5 Android 지원 후 Vector Asset Studio .
에 따라 이 밝히는 :
Vector Asset Studio를 시작하려면 :
- Android Studio에서 Android 앱 프로젝트를 엽니 다.
- 프로젝트 창에서 Android보기를 선택하십시오.
- res 폴더를 마우스 오른쪽 버튼으로 클릭하고 새로 만들기> 벡터 자산을 선택합니다.
- Windows의 이미지로 이동하여 복사하십시오.
- res 폴더로 이동하여 드로어 블 폴더 중 하나를 선택하고 거기에 이미지를 붙여 넣습니다.
- imageview를 클릭 한 다음 속성으로 이동하여 src가 보일 때까지 아래로 스크롤합니다.
- 이것을 src @ drawable / imagename에 삽입하십시오.
Android Studio 내에서 쉽게이 작업을 수행하려면 왼쪽의 파일 디렉터리 바로 위에 다음 과 같은 파일을 보는 방법에 대한 옵션이 있는 드롭 다운 이 표시됩니다 .
Project, Android, and Packages, plus a list of Scopes.
If you are on Android it makes it hard to see when you add new folders or assets to your project - BUT if you change the dropdown to PROJECT then the file directory will match the file system on your computer, then go to:
app > src > main > res
From here you can find the conventional Eclipse type files like drawable/drawable-hdpi/drawable-mdpi and so on where you can easily drag and drop files into or import into and instantly see them. As soon as you see your files here they will be available when going to assign image src's and so on.
Good luck Android Warriors in a strange new world!
To import files from OS X Finder into Android Studio, just drag the relevant files to your resource folder.
- Drag & Drop by default moves files to your project (not what you always want)
- Pressing ⎇ (Alt) while dragging copies files
Don't find a permanent config option for this, but this is the workaround I'm using
For Mac + Android Studio 2.1, I found the best way is to save the image and then copy (cmd + c
) the image file in Finder and then click on the the drawable
directory and cmd + v
to paste in that directory. Copying the image directly from a website using cmd + c
(or right click then copy) doesn't seem to work.
For Android Studio:
Right click on res, new Image Asset
Select the image radio button in 3rd option i.e Asset Type
Select the path of the image and click next and then finish
All the images are added to the respective folder, its very simple
You can simply use the terminal that comes with Android Studio. It is listed at the bottom of Android Studio. Just open it and use the cp
command.
I'm in Mac OSX as well and in a new project I need to:
- Right click on res folder in the project and add a new Android resource directory.
- Select drawable from the drop down and Accept.
- Copy and paste the image into the drawable folder.
Disclaimer : This does NOT cover different resolutions etc.
'code' 카테고리의 다른 글
Mavericks로 느린 IOS 시뮬레이터 (0) | 2020.10.15 |
---|---|
실행 중 셸 스크립트 편집 (0) | 2020.10.15 |
Swift에서 'catch all'예외의 세부 사항을 인쇄하는 방법은 무엇입니까? (0) | 2020.10.14 |
JDK와 Java SDK의 차이점 (0) | 2020.10.14 |
HTML에 글꼴을 포함하는 방법은 무엇입니까? (0) | 2020.10.14 |