android - how to set a textview in inflater layout for close mark? -
i'm new android
i'm facing problem in inflate layout set close mark
how set close mark in inflater? how implement this?
any 1 me.
i try this..
layoutinflater inflater = (layoutinflater) getsystemservice(context.layout_inflater_service); viewlist = nexttopic.this.getlayoutinflater().inflate(r.layout.activity_nexttopic, null); dialogmarketlist = new dialog(nexttopic.this); dialogmarketlist.requestwindowfeature(window.feature_no_title); dialogmarketlist.settitle("topics"); dialogmarketlist.setcontentview(viewlist); dialogmarketlist.show(); lvfordialog = (listview) viewlist.findviewbyid(r.id.list_view); lvfordialog.settranscriptmode(listview.transcript_mode_always_scroll); arrayadapter<string> adapter = (new arrayadapter<string>(nexttopic.this, r.layout.row_topic, r.id.child_row,tnamelist)); lvfordialog.setadapter(adapter);
activity-nexttopic.xml
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:android1="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".nexttopic" > <listview android1:id="@+id/list_view" android1:layout_width="match_parent" android1:layout_height="330dp" android1:layout_centerhorizontal="true" android1:layout_centervertical="true" android:background="@drawable/bg"> </listview> </relativelayout>
row_topic.xml
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightsum="1"> <textview android:id="@+id/c_txt" android:layout_width="fill_parent" android:layout_height="50dp" android:text="x" android:textsize="25dp" android:gravity="right"/> <textview android:id="@+id/child_row" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/c_txt" android:layout_margintop="27dp" android:background="@drawable/bg" android:gravity="center_vertical" android:minheight="?android:attr/listpreferreditemheight" android:paddingleft="6dip" android:textcolor="@android:color/white" /> </relativelayout>
its coming each text view in list above cross mark displaying....
you should place close mark in activity-nexttopic.xml layout instead of row_topic.xml. whatever place in row_topic.xml repeated every row in listview.
Comments
Post a Comment