2017-05-31 10 views

答えて

0

私は自分の質問への答えを考え出しました。 コードは次のとおりです。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <HorizontalScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent"> 
      <Button 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:text="Button 1"/> 
      <Button 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:text="Button 2"/> 
      <Button 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:text="Button 3"/> 
      <Button 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:text="Button 4"/> 
      <Button 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:text="Button 5"/> 
      <Button 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:text="Button 6"/> 

     </LinearLayout> 
    </HorizontalScrollView> 
</LinearLayout>