마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

어떻게 해야, 이런 리니어 레이아웃의 구조를 만들수 있을까요..?

0 추천

 

안녕하세요..

제가 아래의 사진과 같은, 구조를 만들고 있는데 잘 안되는 부분이 있어서 글을 올립니다.

아래에 보면, 지역별과 특별관 부분은, 한줄의 리니어 레이아웃을 통해 가중치값을 주어서

1:1 비율로 만들었습니다.

 

그런데, 왼쪽라인에 지역별부분에 세로로 되어 있는 서울, 인천/경기,대전/충청/세종, ... 제주까지 어떻게 만들어야 할지 잘 모르겠습니다..

 

아예 처음에 지역별과 특별관을 만들었을 때처럼, 한 리니아웃에 이어서, 계속 만들고 싶었으나

지역별에서 고르는 지역에 따라서, 특별관에서의 나오는 내용들이 바뀌는 바람에.. 일단, 왼쪽라인의

리니어 레이아웃으로 vetical을 세로로 주어서, 만들어 보려고 하는데, 지역별 아래있는 레이아웃의 크기가

한 레이아웃의 반만 차지해야 하는데.. 어떻게 해야 저렇게 만들어 줄지 고민입니다 ㅠ

강제로 dp값을 주어주자니, 해상도가 다른 화면에서 꺠질것이 뻔할테고..

어떻게 해야, 바로 아래의 사진처럼, 서울에서부터 제주까지 깔끔하게 지역별이 끝나는 위치와 같이

위치시킬수가 있을까요..? 코드가 조금 추가되는 관계로, 댓글부분에 좀 더 붙여보겠습니다 ㅠ

 

+ 그리고 더해서, 서울을 눌렀을때는, 특별관 부분에 지역이 아래와 같이 나오고

인천/경기를 눌렀을때는, 특별관 부분이 다른 지역이 나와야 하는데..

이런 부분은 대략적으로 어떻게 만들어야 할까요?

 

<Location.xml 코드입니다>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_location"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="ex.real_project.Location">

    <RelativeLayout
        android:id="@+id/Location_Toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/Location_Date_and_Seat_Image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="3dp"
            android:layout_marginLeft="3dp"
            android:background="@drawable/before_image" />


공산당 (1,960 포인트) 님이 2016년 11월 1일 질문
공산당님이 2016년 11월 1일 수정
<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="영화관 선택"
            android:textSize="30dp"
            android:textStyle="bold"
            android:layout_marginTop="10dp"
            android:layout_centerHorizontal="true" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="선택완료"

            />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/location_selection" />

    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <Button
            android:id="@+id/Linear_Layout_Location"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="지역별" />


        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="특별관" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/Location_d1"
        android:layout_width="193dp"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="서울" />


        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="인천 / 경기" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/Location_d2"
        android:layout_width="193dp"
        android:layout_height="wrap_content"

        android:orientation="vertical">

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="강남" />


        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="동대문" />

    </LinearLayout>



</LinearLayout>

1개의 답변

0 추천
여러가지 옵션이 있을 수 있겠지만, 바로 떠오르는 건

상단 탭 2개

하단은 리스트뷰 2개 또는

왼쪽 리스트뷰, 오른쪽 LinearLayout을 배치하여 동적으로 TextView를 LinearLayout에 추가.
둘다 LinearLayout 데이터에 따라 TextView를 추가 또는 삭제.
spark (227,830 포인트) 님이 2016년 11월 1일 답변
spark님 답변 정말 감사드립니다 ㅠ

위에 사진이 조금 부족한거 같아서 ,하나를 추가해 보았습니다.
지역관을 눌렀을 경우에는, 위의 사진처럼 나오고, 특별관을 눌렀을때는
위와 같이 나옵니다.

결론적으로 보면, 지역관과 특별관을 눌렀을떄 각각 다른 화면이 아래에 나와야
합니다.

그리고 말씀하신걸 제가 이해하기로는, 지역관과 특별관 자체를 상단탭이라고 말씀하신것 같고, 이부분은 탭레이아웃으로 만들라고 말씀하신 건가요?

그리고 하단은 리스트뷰2개 또는 LinearLayout을 사용하라고 말씀하셨는데,
제가 머리가 많이 모자란 편이라 가장 편하고 직관적인 방법으로 한다면
리스트뷰2개로 하려고 하는데.. 괜찮을까요..?

답변 주시면 정말 감사드리겠습니다 ㅠ
...