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

탭 클릭 관련해서 질문이 있습니다.

0 추천

 

안녕하세요 ㅠㅠ

며칠쨰, 이 부분을 어떻게 해야할지 몰라서 주구장창 질문만 올려대고 있습니다..

다름이 아니라, 지역관과, 특별관 이 부분을 어떤걸로 만들어야 좋을지 고민입니다.

지역관 부분을 누르면, 1번째 이미지가 나와야 하고, 특별관 부분을 누르면, 2번째 이미지와 같이 나와야합니

다. 결론적으로 보면, 지역관과 특별관을 누를때, 그 아래의 내용들이 변해야 한다는것인데,

이 부분을 어떻게 만들어 주어야 할지 고민입니다. 처음에는 리니어 레이아웃으로 지역별과 특별관

부분을 만들었었는데.. 그다지 좋은 방법은 아닌것 같다는 말씀들을 많이 들어서 고민이네요.. 

아래의 제가 만든 부분의 xml 소스를 한번 첨부해 보겠습니다. 소스가 조금 넘치는 부분은 댓글부분에

따로 추가로 붙여보겠습니다.

 

<1번쨰 사진>

<2번쨰 사진>

 

<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월 2일 질문
<TextView
            android:id="@+id/Location_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:id="@+id/Loation_Selection"
            android:layout_toRightOf="@+id/Location_TextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="선택완료"
            android:layout_marginLeft="60dp"
            />

    </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"
        android:orientation="horizontal">

        <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>

1개의 답변

0 추천
리스트뷰를 사용하시는게 나을 것 같아요
방랑자 님이 2016년 11월 2일 답변
답변 감사드립니다.
어느 부분을, 리스트 뷰로 사용하는게 나을것을 말씀하시는건가요 ..?
제가 아직 많이 초보이다 보니까, 깊게 잘 모르겠습니다.
지역별과 특별관 이 첫줄을 말씀하시는건가요ㅕ?
일단

맨위에

지역별, 특별관

이 두개는 탭호스트를 이용하셔서 구현하시고요.
아니면 텍스트뷰로 2개를 하셔도 크게 상관은 없을 것 같아요.

그리고 지역별에서 지역리스트(서울, 인천/경기 등등 잇는곳)와
지역을 눌렀을때 나오는 리스트(강남, 동대문 등등 잇는곳)
이 두개를 전부 리스트뷰로 하시고

지역별, 특별관을 누를때 리스트뷰를 데이터를 새로넣어주고
서울을 누르면 오른쪽 지역리스트를 새로고침해주면 될것같아요.

글재주가 없어서 글로 설명하려니 힘드네여



간단하게

지역별, 특별관 부분은 탭호스

그 아래 반반 차지하는 리스트 2개는 리스트뷰 입니다.
우와ㅠ 너무 감사합니다.
말씀하신걸 토대로, 열심히 만들어보겠습니다.
말씀하신 반반을 차지하는 리스트뷰 2개라는 말씀은, 세로로 말씀하시는거 맞나요?
...