80,351
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scroll"
android:fillViewport="true"> <!-- 设置 ScrollView 的 android:fillViewport="true"就可以让下面的 LinearLayout充满屏幕-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="提交厨房"
android:id="@+id/TiJiaoChuFang"/>
<Button
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="删除选中项"
android:id="@+id/ShanChuXuanZhongXiang"/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/XuanZeDeCai">
</ListView>
</LinearLayout>
</ScrollView>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="名称: "
android:textSize="20dp"
android:id="@+id/labMingCheng1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20dp"
android:layout_toRightOf="@id/labMingCheng1"
android:id="@+id/labMingCheng2"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="删除"
android:id="@+id/delete"
android:layout_alignParentRight="true"
android:layout_below="@id/labMingCheng1"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/iFenShu"
android:textSize="20dp"
android:text="1"
android:layout_alignLeft="@id/labMingCheng2"
android:layout_below="@id/labMingCheng1"
android:layout_toLeftOf="@id/delete" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="份数: "
android:textSize="20dp"
android:id="@+id/labFenShu"
android:layout_below="@id/labMingCheng1"
android:layout_alignBottom="@id/iFenShu"
android:gravity="center"/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="楼层"
android:id="@+id/LouCeng"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="房间"
android:id="@+id/FangJian"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="桌号"
android:id="@+id/ZhuoHao"
/>
</LinearLayout>
View HeaderView = View.inflate(this, R.layout.selectedmenuheader, null);
lv.addHeaderView(HeaderView);
try {
LinearLayout layout = (LinearLayout) lv.getChildAt(i);
TextView tvName = (TextView) layout.findViewById(R.id.labMingCheng2);
EditText etFenShu = (EditText) layout.findViewById(R.id.iFenShu);
CheckBox cb = (CheckBox) layout.findViewById(R.id.delete);
}
catch (Exception ee)
{
Log.i("44445555", ee.toString());
}