80,351
社区成员
发帖
与我相关
我的任务
分享
<com.egov.view.MyScrollLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_below="@id/llayout" >
<com.egov.view.MyFrame
android:id="@+id/myFrame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/white" >
<include layout="@layout/choose"/>
</com.egov.view.MyFrame>
public OnClickListener chooseOnClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Log.i("TOTO", "Start Listener");
Log.i("TOTO", "Start 1");
myFrame = (MyFrame)findViewById(R.id.myFrame);
Log.i("TOTO", "Start 2");
myFrame.removeAllViews();
Log.i("TOTO", "Start 3");
LinearLayout myLinearLayout = (LinearLayout)inflater.inflate(R.layout.mylistview, null);
FrameLayout.LayoutParams viewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// ListView myListView = (ListView)myLinearLayout.findViewById(R.id.my)
Log.i("TOTO", "Start 4");
recordListView = (ListView) myLinearLayout.findViewById(R.id.recordListView);
myFrame.addView(myLinearLayout);
Log.i("TOTO", "Start 5");
Button btnButton = new Button(MainTOTO.this);
btnButton.setText("Test");
myFrame.addView(btnButton, viewParams);
problems = new ProblemsLVAdapter(MainTOTO.this);
problems.notifyDataSetChanged();
// setContentView(R.layout.activity_main);
recordListView.setAdapter(problems);
recordListView.setCacheColorHint(0);
recordListView.setOnItemClickListener(onItemClickListener);
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="@+id/recordListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="@android:color/transparent"
android:divider="@drawable/reader_item_divider"
android:listSelector="@drawable/item_selector" >
</ListView>
</LinearLayout>