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

이미지뷰를 좌우 슬라이드가 가능하게 만들고 싶습니다

0 추천
MainActivity 에서 MainFragment 를 열도록 했구요

protected Fragment createFragment() {
    // TODO Auto-generated method stub
    return new MainFragment();
}

 

MainFragment 의 xml이 아래처럼 했습니다.

그런데 ImageView 부분에 2개의 이미지가 있어서 좌우로 슬라이드를 할수 있게 하고 싶습니다.

아래의 Spinner 와 Button은 그대로 유지하구요..

어떻게 xml를 만들고 어떻게 개념을 생각해야 하는지 문의 드립니다.

혹시 비슷한 내용을 공부할 수 있는 사이트가 있으면 도움 부탁 드립니다.

 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="top" >

        <ImageView
            android:id="@+id/image"
            android:layout_width="match_parent"
            android:layout_height="180dp"
            android:layout_gravity="center_horizontal"
            android:src="@drawable/sample"
            android:background="#ffffffff"/>

    </LinearLayout>

    <LinearLayout
    android:id="@+id/ll_input"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:orientation="horizontal"
    android:background="#ffffffff">

    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="3"
        android:text="내용선택"/>

    <Spinner
        android:id="@+id/spn"
        android:layout_width="0dp"
        android:layout_height="36sp"
        android:layout_weight="7"
        android:spinnerMode="dialog"></Spinner>

    </LinearLayout>

    <Button
    android:id="@+id/button_ok"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="저장하기" />

</LinearLayout>
삼국지 (750 포인트) 님이 2016년 11월 16일 질문

1개의 답변

+1 추천
ViewPager 검색해서 활용해보세요
qweqweq (4,220 포인트) 님이 2016년 11월 16일 답변
...