-1

Ich habe eine ListView:haben Radio-Button auf Listenelement

<ListView 
     android:id="@+id/my_list" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" /> 

Das Layout jede Artikelzeile der Listenansicht ist:

<? Xml version = "1.0" encoding = "utf-8"?> 
<LinearLayout 
    xmlns: android = "http://schemas.android.com/apk/res/android" 
    android: orientation = "horizontal" 
    android: layout_width = "fill_parent" 
    android: layout_height = "fill_parent" 
    > 
    <ImageView 
      android: id = "@+id/my_img" 
      android: layout_width = "wrap_content" 
      android: layout_height = "wrap_content" 
      android: layout_gravity = "center_vertical"   
      /> 
    <TextView 
     android: id = "@+id/my_value" 
     android: layout_width = "wrap_content" 
     android: layout_height = "wrap_content" 
     android: textColor = "@drawable/ black" /> 
</ LinearLayout> 

Wie Sie oben sehen, jede Reihe der Liste besteht aus einem ImageView und einem TextView. Jetzt würde ich gerne eine Radiobutton neben der TextView haben, wie Radioknopf in meinem Fall hinzufügen?

+1

Verwenden 'Relativelayout' und' add Ende Textview' –

+0

Wo ist die Frage? – Dharmendra

Antwort

1

versuchen, dieses

<? 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 = "fill_parent" 
    > 
    <ImageView 
      android: id = "@+id/my_img" 
      android: layout_width = "wrap_content" 
      android: layout_height = "wrap_content" 
      android:layout_algnParentLeft="true" 
      android: layout_centerVertical = "true"   
      /> 
    <TextView 
     android: id = "@+id/my_value" 
     android: layout_width = "wrap_content" 
     android: layout_height = "wrap_content" 
     android:layout_toRightOf="@id/my_img" 
     android: textColor = "@drawable/ black" /> 
    <RadioButton 
     android: id = "@+id/radio" 
     android: layout_width = "wrap_content" 
     android: layout_height = "wrap_content" 
     android:layout_toRightOf="@id/my_value" /> 

</ RelativeLayout> 
+1

Vipin können Sie uns erklären, was die Frage ist? – RobinHood

+0

@robinhood Leem.fin hat seine Frage nach meiner Antwort bearbeitet, weiß nicht, warum – vipin

+1

er ein xml gegeben hatte und er fragte, wie man Radio vor der Textansicht hinzufügt – vipin