English 中文(简体)
表格 Layout团体动态无线电台
原标题:Android TableLayout group dynamic radioButtons
  • 时间:2011-10-23 10:49:14
  •  标签:
  • java
  • android

我怎么能把所有有活力的无线电布特顿混为一谈?

while (cursor.moveToNext()) {
    TableRow row = new TableRow(this);
     // CheckBox chk = new CheckBox(this);
      RadioButton  radioBtn =  new RadioButton(this);
     // chk.setText(cursor.getString(cursor.getColumnIndex("from_text")));
      radioBtn.setText(cursor.getString(cursor.getColumnIndex("from_text")));
      radioBtn.
      row.addView(radioBtn);
      table.addView(row);
}

<>Xml

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />

        <TableLayout
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:id="@+id/myTable"/>         
</LinearLayout>
问题回答

为了处理无线电台,它们必须安装在<射线>上。 如果你将无线电塔顿放在单独的桌子里,那么你就不得不实施集团行为。

http://developer.android.com/vis/android/widget/CompoundButton.html#setOnCheckedChangeListener%28android.widget.CompoundButton.OneckedChangeListener%29”rel=“nofollow”。 RadioButton.SetOnCheckedChangeListener(),登记一位响应检查活动的听众。

可查阅rel=“nofollow”>RadioGroup source Code,以了解如何通过无线电集团布局进行这项工作。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签