我是android新手。水平滾動查看和佈局 - Android
我想圖像按鈕上的圖像的頂部在一個水平滾動視圖(橫向模式電話)的網格,使得在網格視圖滾動背景圖像和圖像按鈕一起
我想是這樣相對佈局,水平滾動視圖,線性佈局(具有背景圖像),gridview(具有圖像按鈕的行和列)
我似乎無法覆蓋圖像頂部的圖像按鈕在gridview。它似乎工作,如果我把一個圖像按鈕的線性佈局,但我需要他們在網格中。我如何去做這件事?在此先感謝
如果我嘗試把圖像按鈕,網格視圖,我得到渲染錯誤: addView(查看,的LayoutParams)在適配器的觀點是不支持
也許我應該使用網格佈局?
Build.gradle (Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.tim.myapplication"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.
AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile
('proguard- android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:gridlayout-v7:25.3.1'
}
認爲吉他指板的圖像,並試圖添加按鈕的字符串。謝謝 – Tim