Module 수준의 build.gradle에 추가

 

    dependencies{

        implementation "org.jetbrains.anko:anko-commons:$anko_version"

        ****

        ****

        ****

    }

 

Project 수준의 build.gradle에 추가

 

    buildscript{

        ****

        ext.anko_version = '0.10.5'

        ****

    }

'Android' 카테고리의 다른 글

RelaytiveLayout  (0) 2020.03.23
LinearLayout : orientation/weight  (0) 2020.03.23
무료아이콘 다운로드  (2) 2017.02.02
스플래쉬 참고  (0) 2017.02.01
[스터디] 1. 카카오톡 패스워드입력 화면 구성  (0) 2016.12.05

기준뷰 id값 설정 -> 다른 뷰에서 기준뷰의 id값을 이용하여 위치를 지정

<RelativeLayout

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@mipmap/ic_launcher_round">

 

    <TextView
        android:id="@+id/standard"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="true"
        android:text="기준 뷰"
        android:textColor="#FF0000"
        android:textSize="30dp"
        android:gravity="center_vertical"
        android:textAlignment="center"
        android:background="@color/colorPrimaryDark"/>

    <TextView
        android:layout_toRightOf="@+id/standard"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="false"
        android:text="1번 뷰"
        android:textColor="#FF0000"
        android:textSize="30dp"
        android:gravity="center_vertical"
        android:textAlignment="center"
        android:background="@color/colorAccent"/>

    <TextView
        android:layout_below="@+id/standard"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="true"
        android:text="2번 뷰"
        android:textColor="#FF0000"
        android:textSize="30dp"
        android:gravity="center_vertical"
        android:textAlignment="center"
        android:background="@color/colorPrimary"/>

</RelaytiveLayout>

'Android' 카테고리의 다른 글

Anko 라이브러리 추가  (0) 2020.03.30
LinearLayout : orientation/weight  (0) 2020.03.23
무료아이콘 다운로드  (2) 2017.02.02
스플래쉬 참고  (0) 2017.02.01
[스터디] 1. 카카오톡 패스워드입력 화면 구성  (0) 2016.12.05

 

리스트뷰 가로/세로 설정 : horizontal/vertical

layout_weight 가중치 설정

<LinearLayout
    android:layout_width="match_parent" 
    android:layout_height="500dp" 
    android:orientation="horizontal" 
    app:layout_constraintHorizontal_weight="5" 
    android:background="@mipmap/ic_launcher_round" 
    tools:ignore="MissingConstraints"> 

    <TextView
        android:layout_width="100dp" 
        android:layout_height="100dp" 
        android:layout_weight="1" 
        android:background="@color/colorPrimaryDark"/> 
    <TextView
        android:layout_width="100dp" 
        android:layout_height="100dp" 
        android:layout_weight="1" 
        android:background="@color/colorAccent"/> 

    <TextView

        android:layout_width="100dp" 
        android:layout_height="100dp" 
        android:layout_weight="1" 
        android:background="@color/colorPrimary"/> 
</LinearLayout>

 

<LinearLayout

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    app:layout_constraintHorizontal_weight="5"
    android:background="@mipmap/ic_launcher_round"
    tools:ignore="MissingConstraints">

 

    <TextView

        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_weight="1"
        android:background="@color/colorPrimaryDark"/>

    <TextView

        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_weight="1"
        android:background="@color/colorAccent"/>

    <TextView    

        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_weight="2"
        android:background="@color/colorPrimary"/>

</LinearLayout

'Android' 카테고리의 다른 글

Anko 라이브러리 추가  (0) 2020.03.30
RelaytiveLayout  (0) 2020.03.23
무료아이콘 다운로드  (2) 2017.02.02
스플래쉬 참고  (0) 2017.02.01
[스터디] 1. 카카오톡 패스워드입력 화면 구성  (0) 2016.12.05

+ Recent posts