2016-05-18 6 views
-1

バックグラウンドでイメージを繰り返すにはどうすればいいですか?私はスクロールビューに画像(ノートブックシート)を入れようとしています。しかし、私はそれを作る方法を理解することはできません。あなたは私に例を挙げることができますか? 私はアンドロイドプログラミングでは新しいです。スクロール中にイメージを繰り返す方法は?

PD:私の悪い英語のために申し訳ありません。

+0

質問が不明です。達成しようとしていることの例がありますか?何を試しましたか? –

答えて

0

私が正しくあなたを理解できない場合は、この方法でお手伝いします。

インポートする "img_blue_gray.png"

のような描画イメージが次にDrawableのフォルダ

repeating.xml

<?xml version="1.0" encoding="utf-8"?> 
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
     android:src="@drawable/img_blue_gray" 
     android:tileMode="repeat" 
/> 
でxmlファイルを作成します

例:使用方法 レイアウト。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parrent" 
    android:layout_height="match_parrent" 
    android:orientation="vertical"> 
    <ScrollView 
     android:id="@+id/scrollView2" 
     android:layout_width="match_parrent" 
     android:layout_height="match_parrent" 
     android:layout_gravity="center_horizontal" 
     android:background="@drawable/repeating.xml"> 

     /* Your other views */ 

    </ScrollView> 
</LinearLayout>  
+0

ありがとうございました!それは動作します! –

関連する問題