2012-04-09 6 views
1

hello sir私はサーバーデータベースからすべてのmenunamesを取り出し、edittext.ifに追加します。私が押した場合のEditTextはそのXMLでsingline=trueを持っているdoes'tので、しかし、それを追加する。これ私のXMLコードおそらくpress enterは、アンドロイドのcustoimzed listviewの最後のeditextを意味しません。

  <?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" > 

<ImageView 
    android:id="@+id/menuimage" 
    android:layout_width="75dip" 
    android:layout_height="79dip" 
    android:scaleType="centerCrop" 
    android:src="@drawable/stub" /> 

<EditText 
    android:id="@+id/editmaimenu" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="80dp" 
    android:layout_marginTop="25dp" 
    android:singleLine="true" > 
</EditText> 

</RelativeLayout> 

答えて

0

を...それは最後のEditTextにfoucsすることはできませんEDITTEXT最後berforeを入力

   this is mycode 

     public View getView(int position, View convertView, ViewGroup parent) { 
    final ViewHolder holder; 


    if (convertView == null) { 
     holder = new ViewHolder(); 
     convertView = inflater.inflate(R.layout.editmainmenulist, null); 
     holder.caption = (EditText) convertView 
       .findViewById(R.id.editmaimenu); 
     holder.caption1=(ImageView) convertView.findViewById(R.id.menuimage); 
     convertView.setTag(holder); 
    } else { 
     holder = (ViewHolder) convertView.getTag(); 
    } 
    //Fill EditText with the value you have in data source 
    holder.caption.setText(itemnames[position]);//i append database name to the editext 
    holder.caption.setId(position); 
    holder.caption1.setImageBitmap(bmps[position]); 

    //we need to update adapter once we finish with editing 
    holder.caption.setOnFocusChangeListener(new OnFocusChangeListener() { 
     public void onFocusChange(View v, boolean hasFocus) { 
      if (!hasFocus){ 
       final int position = v.getId(); 
       final EditText Caption = (EditText) v; 
       itemnames[position] = Caption.getText().toString(); 


       arr.add(Caption.getText().toString()); 



      } 
     }  
    }); 



    return convertView; 
} 
} 

class ViewHolder { 
EditText caption; 
ImageView caption1; 
} 

class ListItem { 
String caption; 
    } 

+0

...それが正常に動作アンドロイドようになります:私は私のXMLコードを投稿 – prakash

+0

@prakashをlasteditext集中することができない単一行=「true」を – ngesh

+0

...そして、あなたのxmlを投稿..私はeditextプロパティに追加しかし、それは唯一の – prakash

関連する問題