반응형

 

이클립스..안드로이드....

 

jar 파일 import 했는데 적용이 안됐다

 

하나씩 확인해보자

 

1. jar 파일 까보면 .class 가 아닌 .java 로 되어있는지

2. libs 폴더에 넣고 해당 jar 파일 우클릭 -> build path -> add build path 했는지

3. 프로젝트 우클릭 -> properties -> Java Build Path -> Order and Export 에서 해당 jar 파일 체크 되어있는지

 

나는 마지막 3번.. import 시켜놧더니만 이클립스 툴 자체의 properties 에서 체크를 안해놔서 import가 안됐었다..

인텔리제이만 써가지고..;; 이런경우보니까 너무 당황스럽다 ㅠㅠ

 

참고로 Android private libraries 체크해제 안하면 에러뜬다; 쟤도 꼭 체크해제 해주길

728x90
반응형

 

그런일이 일어나서는 안되겠지만

혹시 이클립스로 안드로이드를 작업하는 일이 생긴다면...

 

아래와 같은 오류메세지를 볼수도있다

 

Android Dx Error1, Failed to convert to Dalvik format

 

그럴때는 프로젝트 우클릭 -> Properties -> Java Build Path -> Order and export 클릭

 

Android Private Libraries 체크를 해제해주자

 

728x90
반응형

 

강의를 듣다보니 예전 안드로이드스튜디오랑은 좀 다른게 생겨서 메모해놓는다

empty Activity 만들고싶은데 워낙 선택지가 많아서 헷깔렸다

 

방법1. 바로선택

방법2. Gallery 보고 선택

New > Activity > Gallery 선택

 

 

Empty Views Activity 선택

 

Activity 이름 설정

이때 Activity Name 과 Layout Name을 잘 맞춰야한다

 

커서를 앞으로 이동하여 Main을 지우고 다른 문자로 바꾸면 괜찮지만, 전체삭제한경우 activity_가 prefix로 붙지않는 경우도 있기 때문이다

 

 

혹시나 activity 생성하고나서 setContentView(R.layout.레이아웃이름) 부분이 제대로 import안되더라도 걱정하지말자

일시적으로 import 인식을 못하는것같다.

 

한번 실행해보면 오류없이 실행됨!

 

728x90
반응형

TextView

html 의 p태그와 비슷하며, 텍스트를 입력할 수 있다

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="소개팅 앱!!"
 />

 

match_parent : 부모요소의 길이

예제를 기준으로, textView 상위 부모의 width 를 따라간다

 

wrap_content : 해당요소의 길이

예제를 기준으로, text 요소의 height를 입력한다

LinearLayout

여러 요소를 줄세우는 div

세로, 가로 가능

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    app:layout_constraintBottom_toBottomOf="parent"
    tools:layout_editor_absoluteX="0dp">
    
    <Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/mainColor"
    android:layout_margin="10dp"
    android:textColor="@color/white"
    android:text="Login" />

</LinearLayout>

orientation = vertical : 세로정렬

 

 

728x90

+ Recent posts