자린고비 독학하기/자린고비 코딩하기 (81) 썸네일형 리스트형 Android Studio - Viewpager Viewpager 데이터를 페이지 단위로 표시 페이지 전환이 가능 버튼 세 개를 만들고, 하단에 ViewPager를 뒀다. 버튼을 눌렀을 때 하단 페이지에 불러올 내용 package com.tistory.codedragon.viewex14; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.a.. Android Studio - FrameLayout package com.tistory.jaringobi.layout08; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import androidx.appcompat.app.AppCompatActivity; import static android.view.View.*; public class MainActivity extends AppCompatActivity { Button btn; ImageView ivImage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCre.. Android Studio - Relative Layout Relative Layout에 padding 값만 16dp 주고 위젯 추가. layout_to**Of / align** 를 통해서 기존 위젯 값의 왼쪽 / 오른쪽에 놓거나 버튼 위치를 맞출 수 있다. Relative Layout 안에 Linear Layout 넣고, padding 16dp 주고 위젯 추가. 상단 결과보다 조금 더 깔끔하다. Android Studio - Linear Layout: gravity / margin GRAVITY 자식 내부의 구성요소 위치를 gravity 속성으로 변경할 수 있다. android:gravity - top, bottom, right, left, center 값 존재 android:gravity="left|center_vertical" | 를 통해 위치를 조금 더 세부적으로 지정할 수 있다. margin / padding weight weight 값을 부여해서 세로 길이의 비율을 지정할 수 있다. 작게 하고 싶은 것은 작은 값을, 크게 하고 싶은 것은 큰 값을 지정하면 된다. 상대 값이 지정된다. Android Studio - Linear Layout: 위젯 추가 activity_main.xml match_parent : 부모 컨테이너가 가지는 길이와 같게 해 준다 wrap_content: 필요한 길이만 사용한다 @+id : 새로 선언하는 리소스 아이디를 등록하겠다 @id: 기존에 사용하고 있던 리소스 아이디를 참조하겠다 Linear Layout: vertical Linear Layout: horizental Android Studio - dependency 추가하는 법 1. 수동으로 추가해 주기 https://bintray.com/bintray/jcenter Bintray jcenter - Maven, Gradle, Ivy, SBT, Groovy, Clojure central repository bintray.com 2. 인터페이스를 통해 추가해 주기 File - Project Structure - Dependencies Android Studio - Setting / mainActivity Auto Importing Setting - Editor - General - Auto Import MainActivity 자동으로 생성되는 클래스이다. AppCompatActivity / Activity 등을 상속받을 수 있다 아래에 분석해 두었다. MIPMAP 3차원 그래픽스의 텍스처 매핑 분야에서, 밉맵은 렌더링 속도를 향상시키기 위한 목적으로 기본 텍스처와 이를 연속적으로 미리 축소시킨 텍스처들로 이루어진 비트맵 이미지의 집합이다. 밉맵스라고도 한다. - 출처: https://ko.wikipedia.org/wiki/%EB%B0%89%EB%A7%B5 JAVA - 클래스 변수, 인스턴스 변수, 지역 변수 클래스 변수 static 모든 인스턴스가 같은 값을 가져야 할 때 선언 메모리에 딱 한 번만 올라감 인스턴스 변수 인스턴스가 생성될 당시 생성, 인스턴스별로 다른 변수 값을 가질 수 있음 지역 변수 해당 메서드 안에서만 사용 가능 메서드 실행시 메모리 할당, 실행 끝나면 삭제 요약 출처: https://itmining.tistory.com/20 이전 1 ··· 4 5 6 7 8 9 10 11 다음