반응형

 

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

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
반응형

 

에뮬을 실행했더니 아래와 같은 오류가 확인되었다

 

Waiting For debugger

Application [프로젝트명] (process com.example.폴더명) is waiting for the debugger to attach.

 

Error running 'app'

Processes com.example.sogating are not found. Aborting session.

 

코틀린 안드로이드 개발은 처음인데.. java 처럼 오류메세지가 와락 뜨는게 아니라서 디버깅하는 방법을 공부하는중..

 

일단 에뮬이 냅다 꺼진다면, 로직이 잘못된것이므로 코드를 하나씩 지워가면서 오류포인트를 찾았다.

뭐 설정이고 무슨 문제가 아니라, 로직문제가 없는지 확인할것..!

728x90
반응형

 

Android Studio Card Stack View

Android Studio 개발 시 아래 저장소의 yuyakaido CardStackView 를 import 하는데, dependencies 추가해도 안됐다

https://github.com/yuyakaido/CardStackView.git

 

GitHub - yuyakaido/CardStackView: 📱Tinder like swipeable card view for Android

📱Tinder like swipeable card view for Android. Contribute to yuyakaido/CardStackView development by creating an account on GitHub.

github.com

 

해결방법

settings.gradle 에 아래 문구 추가

//기존
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

//수정
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        jcenter() //추가
        maven{url 'https://jitpack.io'} //추가
        mavenCentral()
    }
}

 

728x90

+ Recent posts