リストビューの上にSlidingDrawを配置することが可能かどうか、したがってどのようにすればよいか疑問に思っていますか? 状況は次のとおりです。カスタムリストアダプターがあります-レイアウトとすべてを膨らませます-リストを作成します。このリストにスライド ドローを適用したいと思います。しかし、SlidingDrawer コードを使用してメイン レイアウトを xml ファイルとして設定しようとすると、アダプターに干渉していると思われるため、強制的に閉じられます。アドバイスをありがとう。
ここに私のコードの大部分があります:
public class BandApp extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//this is where I have a problem
setContentView(R.layout.main);
Activity activity = this;
activity.setTitle("Title");
final String[] values = {"(where i put some urls)","@","@","@","@"};
MyAdapter Adapter = new MyAdapter(this, values);
setListAdapter(Adapter);
setContentView を削除すると機能しますが、追加すると機能しません(強制的に閉じます)。しかし、これは SlideDrawer を使用した xml レイアウトがある場所です。:/ 助けてくれてありがとう
これはxmlコードです:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:handle="@+id/handle"
android:content="@+id/content">
<ImageView
android:id="@id/handle"
android:layout_width="88dip"
android:layout_height="44dip" />
<GridView
android:id="@id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</SlidingDrawer>
</LinearLayout>