본문 바로가기

카테고리 없음

[안드로이드 링크정리]2019_12_09~2019_12_22 // [onClick, onTouch 동시 사용, ConstraintLayout 설명,add dynamicView(동적뷰생성), ConstraintLayout code로 변경하는 방법.]

반응형

1. onClick과 onTouch를 동시에 사용할 경우 onCick이 제대로 동작하지 않거나, 생각 했던과는 다르게 동작하는 경우가 있다. 두개를 동시에 사용하기 위해서 참고했던 링크.

 

1) 롱클릭, 클릭, 터치를 사용시 어떤 순서로 동작하는 정리되어 있는 링크이다. 

 

https://bitsoul.tistory.com/13 

 

안드로이드 이벤트 : 버튼 클릭,롱클릭, 터치...

안드로이드 이벤트 : 버튼 클릭,롱클릭, 터치... Touch 이벤트와 Click 이벤트 그리고 LongClick 이벤트는 어떠한 관계에 있을까? 그리고 어떤 순서대로 발생할까? 만약 사용자가 특정 버튼을 클릭하면 Touch(down..

bitsoul.tistory.com

2) onTouch 와 onClick을 동시에 사용하기 위해 참고 했던 링크.

 

https://hashcode.co.kr/questions/1013/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-onclick-onlongclick-ontouch-%EB%8F%99%EC%8B%9C%EC%97%90-%EA%B5%AC%ED%98%84%ED%95%98%EA%B8%B0

 

[안드로이드] onClick, onLongClick, onTouch 동시에 구현하기.

제가 안드로이드 스튜디오를 기본서를 가지고 공부를 하였는데 실질적으로 어플을 만들려고 하니 기본서 만으로는 모르는 것이 많아서 기초적인 어플 하나를 가지고 단계를 적용하여 만드는 연습을 하고 있습니다. 기초적인 어플로 단순한 메모장 어플을 만들고 있는데 여기서 listview를 사용하여 메모로 추가한 것을 보여주고 있습니다. 리스트 뷰의 내용은 LinearLayout 을 상속받는 item 클래스가 들어가게 됩니다. 이 아이템 클래스에 text 뷰 안에

hashcode.co.kr

 

2. ConConstraintLayout 설명

 

1) 제목과 동일 - ConstraintLayout 사용과 관련 한 설명이 잘 되어 있는 링크이다.

https://webnautes.tistory.com/1363

 

Android 강좌 - 컨스트레인트 레이아웃를 사용해보자 (ConstraintLayout)

어떻게 사용하는지 알기 어려웠던 컨스트레인트 레이아웃에 조금 친숙해진 기념으로 만든 영상입니다. 다음 순으로 영상이 올라가게 됩니다. 도움이 되었으면 좋아요와 구독을 해주세요. 감사합니다. 컨스트레인트..

webnautes.tistory.com

2) 제목과 동일 - 다른 설명 링크

https://velog.io/@tura/android-jetpack-constraint-layout

 

Android Jetpack - ConstraintLayout

ConstraintLayout은 기존의 여러 가지 ViewGroup들보다 좀 더 유연하게 화면을 만들 수 있게 해줍니다. 이번 글에서는 ConstraintLayout의 사용 방법과 동작 원리를 빠르게 훑어보겠습니다. 사용법 Adding Depdencies 2019년 5월 9일 기준으로 2.0.0의 베타 채널이 배포되었습니다. ...

velog.io

 

3. add dynamicView (동적 뷰 생성)

동적으로 뷰를 생성해야 할 경우 참고 했던 링크이다.

 

1) 먼저 동적뷰를 생성하는 예제 코드이다. 설명이 잘되어 있으므로 일단 해당 예제를 이용하면 이해하기 쉬울 것 같다.

 

https://gihyun.com/62

 

layout에 view 동적으로 생성하기 (Add imageView and textView to linearLayout programmatically)

1. textView 동적 생성 // textView가 추가될 linearLayout LinearLayout layout = (LinearLayout) layout.findViewById(R.id.linearLayout); // layout param 생성 LayoutParams layoutParams = new LayoutParams..

gihyun.com

2) 위와 동일 설명이 잘되어 있어 추가

https://developer88.tistory.com/73

 

Android 에서 동적으로 View 추가하기 #LayoutInflater

안드로이드 앱을 만들다 보면, 동적으로 View를 추가해야 할 경우가 생기는 데요. 오늘은, 이럴 때 어떻게 해야하는지 정리해 보겠습니다. 1. LayoutInflater layout을 생성하는 것은 inflate한다고 하는데요. 참..

developer88.tistory.com

4. ConstratinLayout, RelativeLayout 안에서 코드를 이용해 view를 배치하는 예제 링크.

동적뷰 생성과 더불어 동적으로 생성 된 View를 내가 원하는 곳으로 배치해야 하는 경우가 있을 수 있다. 또는 이미 생성 된 View의 위치를 내가 원하는 방식으로 변경할 때, 레이아웃이 아닌, 코드로 변경해야 하는 경우.

 

1) RelativeLayout 안에서 코드를 통한 View 배치

 

https://gihyun.com/62

 

 

layout에 view 동적으로 생성하기 (Add imageView and textView to linearLayout programmatically)

1. textView 동적 생성 // textView가 추가될 linearLayout LinearLayout layout = (LinearLayout) layout.findViewById(R.id.linearLayout); // layout param 생성 LayoutParams layoutParams = new LayoutParams..

gihyun.com

2) ConstratinLayout 동적 배치

 

1) 참고 했던 사이트 링크1 - 영어로 되어 있으나, 설명이 상세하게 되어 있으므로 참고하기 좋을 것 같아 첨부한다.

 

https://www.zoftino.com/adding-views-&-constraints-to-android-constraint-layout-programmatically

 

Adding Views & Constraints to Android Constraint Layout Programmatically

Adding Views & Constraints to Android Constraint Layout Programmatically April 22, 2017 by Srinivas Using constraint layout, you can create flat layouts. Like any other layouts in android, constraint layouts also can be created in code or defined in xml. I

www.zoftino.com

 

2) 참고 했던 사이트 링크2 - 한국어로 되어 있어 참고 하기 좋음.

https://gamjatwigim.tistory.com/40

 

안드로이드 ConstraintLayout 사용법

ConstraintLayout 기본예제 입니다. http://www.uwanttolearn.com/android/constraint-layout-hell/ 에서 많은 도움을 받았습니다. 최종 결과물은 위와 같습니다. 이미지뷰, 텍스트뷰, 버튼을 이용해서 기본적인..

gamjatwigim.tistory.com

 

3) 그 외에 contratinset(view의 위치를 조정하기 위해 사용)에 관련하여  예제 및 스택플로우의 답변

- 위 링크를 통해 먼저 이해 하거나, contratinset을 먼저 찾아 보고 하는 것이 좋을 것 같다.

 

1) https://www.programcreek.com/java-api-examples/index.php?api=android.support.constraint.ConstraintSet

 

Java Code Examples android.support.constraint.ConstraintSet

Java Code Examples for android.support.constraint.ConstraintSet The following are top voted examples for showing how to use android.support.constraint.ConstraintSet. These examples are extracted from open source projects. You can vote up the examples you l

www.programcreek.com

2) https://stackoverflow.com/questions/45263159/constraintlayout-change-constraints-programmatically/45264822#45264822

 

ConstraintLayout: change constraints programmatically

I need help with ConstraintSet. My goal is to change view's constraints in code, but I cant figure out how to do this right. I have 4 TextViews and one ImageView. I need to set ImageView constrain...

stackoverflow.com

 

 [onClick, onTouch 동시 사용, ConstraintLayout 설명,add dynamicView(동적뷰생성),  ConstraintLayout code로 변경하는 방법.]

 

 

 

반응형