我在TextView
内有Activity
个ScrollView
个SearchBar
。
我的目标是在ScrollView
末尾有TextView
,可以搜索SearchView
。
我在互联网上找到的教程总是建立一个菜单,这不是我的目标。
是否可以设置此method = function(a) {
//use associative array to keep track of the total number of appearances of a value
//in the array
var counts = [];
for(var i = 0; i <= a.length; i++) {
if(counts[a[i]] === undefined) {
//if the condition is looking for a[0],a[1],a[2],a[3],a[4],a[5] inside counts[] one value at a time and does not find them inside counts[] it will set each value to 1
counts[a[i]] = 1;
console.log(counts[a[i]]);
} else {
return true;
}
}
return false;
}
,如果是,如何设置?
答案 0 :(得分:1)
我认为最合适的实现方法是使用SearchView
中的Strings
作为搜索查询,在菜单中创建TextViews
。使用菜单中的SearchView
,如果您搜索某些内容并且屏幕上显示的结果多于适合的结果,您可以向下滚动,但仍然可以在屏幕顶部看到您的搜索查询。因此,您无需向上滚动以执行其他搜索。
答案 1 :(得分:0)
请妥善阐述您的问题。如果你想在TextViews的末尾有一个SearchView,那么只需将它添加到你的布局文件中即可。