【发布时间】:2018-09-14 06:07:46
【问题描述】:
我的应用程序中并排有两个 LinearLayout。在第一个线性布局(左侧)中,我有一些名称列表。我想以这样的方式实现它们之间的连接或关系,当我单击其中一个名称列表项时,一条文本消息或一些设计将显示到第二线性布局(右侧)。 我已经用 Toast 实现了 OnClickListener,但我不知道在第二个线性布局中显示文本消息或一些设计。 提前感谢您的帮助!
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/relLayoutMiddle" android:orientation="horizontal"
android:layout_below="@+id/relLayoutTopBar"
android:layout_above="@+id/relLayoutBottomBar">
<!-- Items List-->
<LinearLayout
android:orientation="vertical"
android:layout_width="80dp"
android:layout_height="fill_parent"
android:layout_marginRight="5dp"
android:background="@drawable/border_design">
<ListView
android:id="@+id/item_List" android:scrollbars="none"
android:layout_width="match_parent"
android:focusable="true"
android:layout_height="fill_parent">
</ListView>
</LinearLayout>
<!-- Display Items-->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" android:layout_marginLeft="5dp"
android:background="@drawable/border_design">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Items will be Display here"/>
</LinearLayout>
</LinearLayout>
【问题讨论】:
标签: android android-layout android-linearlayout