我对这个Android应用程序很新,有几个涉及onclick监听器的问题。Android Button Listerners
现在我在ScrollView中有一个表格,其中一列包含几个按钮。 我的目标是达到一个点,我可以点击一个按钮,然后第二个表会出现在第一个(与第一个相同的布局)旁边,但有一组不同的按钮。有人能指导我在正确的方向。
让我知道如果您有任何问题。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation='vertical' >
<ScrollView
android:layout_width="125dp"
android:layout_height="200dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout android:id="@+id/table_right"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableRow android:id="@+id/row_1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/Button_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 1"
android:textSize="20dp" >
</Button>
</TableRow>
<TableRow android:id="@+id/row_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button android:id="@+id/Button_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 2"
android:textSize="25dp" >
</Button>
</TableRow>
<TableRow android:id="@+id/row_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button android:id="@+id/Button_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button 3"
android:textSize="25dp" >
</Button>
</TableRow>
<TableRow android:id="@+id/row_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button android:id="@+id/Button_4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button 4"
android:textSize="25dp" >
</Button>
</TableRow>
<TableRow android:id="@+id/row_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button android:id="@+id/Button_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button 5"
android:textSize="25dp" >
</Button>
</TableRow>
<TableRow android:id="@+id/row_6"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button android:id="@+id/Button_6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button 6"
android:textSize="25dp" >
</Button>
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
是的请列出您的代码,以便我们可以帮您 – 2013-02-17 17:36:43
设置标签的按钮和处理它。 – 2013-02-17 17:57:15
我加了我到目前为止的所有 – user31610 2013-02-17 18:19:52