我有一个listview,其行包含edittext。 listview的长度为7.当在第一行输入值时,它也插入第7行。我坚持了这个问题最近2天。请任何人帮助我.package
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.wemited.teacherapp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_margin="5dp"
android:background="@drawable/layout_box_corners_blue"
android:orientation="horizontal"
android:weightSum="1" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".23"
android:orientation="vertical" >
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/img"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:scaleType="centerCrop"
/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_weight=".52"
android:orientation="vertical" >
<TextView
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/app_theme_color"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_father"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text=""
android:textColor="@color/app_green"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".25" >
<EditText
android:id="@+id/edt_marks"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/layout_box_corners_blue"
android:gravity="center"
android:hint=""
android:inputType="numberDecimal"
android:maxLength="5"
android:padding="2dp"
android:singleLine="true"
android:textColor="@color/app_theme_color"
android:textColorHint="@color/GrayLight"
android:textCursorDrawable="@null"
android:textSize="13dp" />
<EditText
android:id="@+id/edt_grad"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_below="@+id/edt_marks"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/layout_box_corners_blue"
android:digits="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 "
android:gravity="center"
android:hint=""
android:inputType="numberDecimal"
android:maxLength="3"
android:padding="2dp"
android:singleLine="true"
android:textColor="@color/app_theme_color"
android:textColorHint="@color/GrayLight"
android:textCursorDrawable="@null"
android:textSize="13dp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
这是我的XML布局 -
<ul>
<?php
$i=0;
foreach($players as $player){
$i++;
if($winner){
$winnumber = $i;
echo "<li><span><img src='".$player['avatarfull']."' width='100px' height='100px' /></span></li>";
}
else{
echo "<li><span><img src='".$player['avatarfull']."' width='100px' height='100px' /></span></li>";
}
}
?>
</ul>