好了,所以我試圖找出了這一點,怎麼不知道如何下方繼續 是滾動型看起來背景設置爲@繪製/ patterrepeat挑戰對於Android的ImageButton的背景
<ScrollView 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:fillViewport="false"
android:background="@drawable/patternrepeat">
</ScrollView>
現在patternrepeat是xml drawable看起來像下面這樣
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/pattern"
android:tileMode="repeat"/>
現在這個位圖的src是一個PNG圖像。
的挑戰是如何訪問此「編程」滾動型---->位圖----->位圖原始PNG資源
這樣做的原因是,原來的來源平鋪創建位圖然後將其加載到滾動型創建的背景...
如何將一個與該繼續嗎?
這將工作。沒有問題。你有沒有得到任何錯誤? –
哦,我可能需要一提的,我想是因爲我希望能夠改變它在用戶偏好 –