Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android中2个线性布局内的线性布局_Android_Android Layout_Android Linearlayout - Fatal编程技术网

android中2个线性布局内的线性布局

android中2个线性布局内的线性布局,android,android-layout,android-linearlayout,Android,Android Layout,Android Linearlayout,我必须开发一个可扩展的ListView android示例。我有一个设计问题。请帮帮我。如何解决此错误? 请参考此屏幕截图:请参考我的屏幕截图并为我提供解决方案 我希望采用以下格式: * Order info Payment_method: Payment_method Subtotal Subtotal * CustomerInfo Firstname Firstname Lastname Lastname Phone Phone

我必须开发一个可扩展的ListView android示例。我有一个设计问题。请帮帮我。如何解决此错误? 请参考此屏幕截图:请参考我的屏幕截图并为我提供解决方案

我希望采用以下格式:

* Order info
Payment_method:
      Payment_method
Subtotal
      Subtotal
* CustomerInfo
Firstname
      Firstname
Lastname
      Lastname
Phone
      Phone
这里提到的*是第一组(orderinfo)和第二组(Customerinfo)。这里我想点击第一组,这意味着应该显示付款方式和小计

单击第二组时,应显示firstname、lastname和phone。但在这里,我必须运行应用程序并单击第一组,然后成功显示付款方式和小计。在此之后,一些空间也显示在这里。然后我要点击第二组,意思是先显示一些空格,然后才显示firstname、lastname和phone。如何解决此错误?请给我详细解释一下

这是我的布局文件代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
    android:orientation="vertical" >
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    >
   <TextView
    android:id="@+id/payment_method1"
     android:paddingLeft="5px"
     android:textSize="15dip"
     android:text="payment_method"
     android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/> 
   <TextView
    android:id="@+id/payment_method"
     android:paddingLeft="75px"
     android:textSize="15dip"
    android:textColor="#10bcc9"
    android:textStyle="bold"
     android:text="payment_method"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
   <TextView
    android:id="@+id/subtotal1"
      android:text="subtotal"
     android:paddingLeft="5px"
     android:textSize="15dip"

    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
   <TextView
    android:id="@+id/subtotal"
      android:text="subtotal"
     android:paddingLeft="65px"
     android:textSize="15dip"
    android:textColor="#10bcc9"
    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
    </LinearLayout>
       <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
     >
                  <TextView
    android:id="@+id/firstname1"
     android:paddingLeft="5px"
     android:textSize="15dip"

    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/> 
                   <TextView
    android:id="@+id/firstname"
     android:paddingLeft="65px"
     android:textSize="15dip"
    android:textColor="#10bcc9"
    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

                  <TextView
    android:id="@+id/lastname1"

     android:paddingLeft="5px"
     android:textSize="15dip"

    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
                  <TextView
    android:id="@+id/lastname"

     android:paddingLeft="65px"
     android:textSize="15dip"
    android:textColor="#10bcc9"
    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
    <TextView
    android:id="@+id/phone1"
     android:paddingLeft="5px"
     android:textSize="15dip"

    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/> 
      <TextView
    android:id="@+id/phone"
     android:paddingLeft="65px"
     android:textSize="15dip"
    android:textColor="#10bcc9"
    android:textStyle="bold"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
      </LinearLayout>


       </LinearLayout>

为什么不使用API演示

他们有一些很好的例子来说明如何做到这一点

检查
视图/可扩展列表/
类别

当然你可以定制你想要的方式


可以在
sdk_-manager_-PATH/samples/android-###/ApiDemos
上找到演示(如果您已经通过sdk-manager下载了它们),其中sdk_-manager_-PATH是sdk-manager的安装路径,#是示例的android目标版本(我通常使用最新版本).

请给我一些我不理解的编码教程的附加细节。您的意思是想知道如何运行示例api演示?我无法解决此布局问题。请帮助我。如何更改问题的布局文件请尝试阅读api演示。我同意其中一些是复杂的,但这个肯定不是。此处:。最基本的在线代码是: