【发布时间】:2014-02-23 12:48:58
【问题描述】:
我已经尝试了很多方法来让我的 android ListView 滚动。但是,我的尝试没有成功。下面是我的xml代码。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ListView
android:id="@+id/listview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fastScrollEnabled="true"
android:listSelector="@color/theme_colour"
android:scrollbarStyle="outsideInset">
</ListView>
</RelativeLayout>
我还在下面添加了我的 java 代码。我不知道如何解决这个问题,非常感谢您的帮助。
package com.outdeh;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import com.parse.ParseObject;
import com.parse.ParseQuery;
import com.parse.ParseQueryAdapter;
/**
* Created by horacedaley on 2/15/14.
*/
public class EventsActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listview_main);
populateListView();
}
public void populateListView(){
ParseQueryAdapter<ParseObject> adapter =
new ParseQueryAdapter<ParseObject>(this, new ParseQueryAdapter.QueryFactory<ParseObject>() {
public ParseQuery<ParseObject> create() {
// Here we can configure a ParseQuery to our heart's desire.
ParseQuery query = new ParseQuery("Events");
query.orderByAscending("eDate");
return query;
}
});
adapter.setTextKey("eTitle");
ListView listView = (ListView) findViewById(R.id.listview);
listView.setFastScrollEnabled(true);
listView.setAdapter(adapter);
}
}
【问题讨论】:
-
这仍然没有帮助我。我能够看到工作和一切。但它对整个滚动视图没有帮助。如您所见,我有一个简单的列表视图,我想要的只是滚动...
标签: android listview android-listview scroll