我一直在试图让一个布局展开自己,只要按下查看更多按钮。第二个标题应该与第一个标题具有相同的框。我想使它所以当用户按下“查看更多”按钮,在第二个冠军仍然是展开的文字下面从标题1 layout wireframe如何相对扩展一个图像相对于另一个对象android
这里是我的布局代码:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1"
>
<!-- The ActionBar -->
<include
layout="@layout/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2.43">
<!-- The main content view -->
<RelativeLayout
android:id="@+id/flContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="210dp"
android:id="@+id/img_chucrute"
android:background="@drawable/img_chucrute" />
<ImageView
android:layout_width="130dp"
android:layout_height="30dp"
android:id="@+id/titulo_chucrute"
android:background="@drawable/chucrute_titulo"
android:layout_marginTop="227dp"
android:layout_marginLeft="6dp" />
<ImageView
android:layout_width="80dp"
android:layout_height="25dp"
android:id="@+id/preco_chucrute"
android:background="@drawable/preco_chucrute"
android:layout_marginTop="231dp"
android:layout_marginLeft="272dp" />
<ImageView
android:layout_width="309dp"
android:layout_height="5dp"
android:id="@+id/linha_pagkits"
android:background="@drawable/linha_pagkits"
android:layout_marginTop="270dp"
android:layout_marginLeft="27dp" />
<ImageView
android:layout_width="100dp"
android:layout_height="20dp"
android:id="@+id/titulo_ingredientes"
android:background="@drawable/ingredientes_titulo"
android:layout_marginTop="282dp"
android:layout_marginLeft="29dp" />
<com.example.renan.chefemcasa.ExpandableTextView
android:id="@+id/lorem_ipsum"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="302dp"
android:layout_marginLeft="32dp"
/>
<ImageView
android:layout_width="309dp"
android:layout_height="5dp"
android:id="@+id/linha_apagar"
android:background="@drawable/linha_pagkits"
android:layout_marginLeft="27dp"
android:layout_marginTop="375dp"
android:visibility="gone" />
<ImageView
android:layout_width="309dp"
android:layout_height="5dp"
android:id="@+id/imageView7"
android:background="@drawable/linha_pagkits"
android:layout_marginLeft="27dp"
android:layout_marginTop="370dp" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="visible">
<ImageButton
android:layout_width="180dp"
android:layout_height="50.5dp"
android:id="@+id/imageButton11"
android:background="@drawable/botao_adicionais"
android:layout_marginTop="517dp" />
<ImageButton
android:layout_width="180dp"
android:layout_height="50.5dp"
android:id="@+id/imageButton12"
android:background="@drawable/botao_finalizar"
android:layout_marginTop="-51dp"
android:layout_marginLeft="180dp"/>
</LinearLayout>
<!-- The navigation drawer -->
<android.support.design.widget.NavigationView
android:id="@+id/nvView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
app:headerLayout="@layout/nav_header"
app:menu="@menu/drawer_view" />
感谢您的帮助!
是否要展开和折叠TextView /一些多视图? –