2016-10-20 2 views
0

Я начинаю разработку android developpement и хочу создать HorizontalScrollView, который содержит 2 RelativeLayout. Как это приложение:Как создать HorizontalScrollView с несколькими макетами

"img 1"

И после нажатия на кнопку или прокрутки, вторая раскладка появляется

"img 2"

Мой текущий код:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 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:background="@color/colorPrimaryDark" 
    tools:context="fr.hazpeople.lolbuildcreator.ChampActivity"> 

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

     <ImageView android:id="@+id/background" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/aatrox_bg" 
      android:scaleType="fitStart" 
      android:paddingRight="-1dp" 
      android:adjustViewBounds="true" /> 

     <ImageView android:id="@+id/icon_champ" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:minWidth="72dp" 
      android:minHeight="72dp" 
      android:src="@drawable/aatrox" 
      android:layout_alignBottom="@id/background" 
      android:layout_marginLeft="10dp" /> 

    </RelativeLayout> 

    <!-- HorizontalScrollView here --> 
</RelativeLayout> 

ответ

Смежные вопросы