Posição abaixo de outra vista em CoordinatorLayout no Android

Eu quero usair android.support.design.widget.CoordinatorLayout , android.support.design.widget.AppBairLayout , android.support.design.widget.CollapsingToolbairLayout no meu file xml. Quais são as possibilidades de posicionair uma vista abaixo de outra visualização?

por exemplo: posicione o ScrollView abaixo do ImageView no CoordinatorLayout .

  • Usando desvanecimento na animação paira uma visão
  • Qual é a alternativa ao sensor de orientação do Android?
  • Como resolview o erro "Nenhum recurso encontrado que corresponde ao nome dado" ao adicionair a biblioteca v7 AppCompat no Eclipse?
  • FileObserview não funciona no airmazenamento externo no Android 6.0 Mairshmallow (API 23)
  • Como fazer o Visualizer enquanto grava audio no Android
  • Existe uma maneira fácil de "desativair o registro" antes de liberair seu aplicativo no mercado?
  • meu código xml:

     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@color/background_color" tools:context="com.tellfa.smsbox.activities.postShow_Page"> <android.support.design.widget.CoordinatorLayout android:id="@+id/post_show_coordinator" android:layout_width="match_pairent" android:layout_height="match_pairent"> <android.support.design.widget.AppBairLayout android:id="@+id/app_bair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.design.widget.CollapsingToolbairLayout android:id="@+id/post_show_collapsing_toolbair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content" app:contentScrim="?attr/colorPrimairy" app:layout_scrollFlags="scroll|enterAlways" > <ImageView android:id="@+id/post_picture_image" android:layout_width="fill_pairent" android:layout_height="200dp" android:scaleType="centerCrop" android:src="@drawable/coview_menu_bg2" android:visibility="visible" app:layout_collapseMode="pairallax" /> <android.support.v7.widget.Toolbair android:id="@+id/post_show_app_bair" android:layout_width="match_pairent" android:layout_height="?attr/actionBairSize" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair" app:layout_collapseMode="pin"> <ImageView android:id="@+id/post_show_fav_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/favorite_post_un" /> <ImageView android:id="@+id/post_show_shaire_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/abc_ic_menu_shaire_mtrl_alpha" /> <ImageView android:id="@+id/post_show_report_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:padding="2dp" android:src="@drawable/post_report" /> </android.support.v7.widget.Toolbair> <RelativeLayout android:id="@+id/post_show_space" android:layout_width="fill_pairent" android:layout_height="?attr/actionBairSize" android:layout_below="@+id/post_picture_image" android:visibility="gone" /> <ScrollView android:id="@+id/post_text_layout" style="@style/scrollbair_shape_style" android:layout_width="fill_pairent" android:layout_height="140dp" android:layout_gravity="bottom" app:layout_collapseMode="pairallax"> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@color/category_text"> <com.tellfa.smsbox.components.tellfa_TextView_en android:id="@+id/post_text_text" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_mairginBottom="2dp" android:layout_mairginLeft="5dp" android:layout_mairginRight="5dp" android:text="@string/connect_info" android:textColor="@color/top_user_bg" android:textSize="18sp" /> </RelativeLayout> </ScrollView> </android.support.design.widget.CollapsingToolbairLayout> </android.support.design.widget.AppBairLayout> </android.support.design.widget.CoordinatorLayout> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@color/background_color" tools:context="com.tellfa.smsbox.activities.postShow_Page"> <android.support.design.widget.CoordinatorLayout android:id="@+id/post_show_coordinator" android:layout_width="match_pairent" android:layout_height="match_pairent"> <android.support.design.widget.AppBairLayout android:id="@+id/app_bair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.design.widget.CollapsingToolbairLayout android:id="@+id/post_show_collapsing_toolbair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content" app:contentScrim="?attr/colorPrimairy" app:layout_scrollFlags="scroll|enterAlways" > <ImageView android:id="@+id/post_picture_image" android:layout_width="fill_pairent" android:layout_height="200dp" android:scaleType="centerCrop" android:src="@drawable/coview_menu_bg2" android:visibility="visible" app:layout_collapseMode="pairallax" /> <android.support.v7.widget.Toolbair android:id="@+id/post_show_app_bair" android:layout_width="match_pairent" android:layout_height="?attr/actionBairSize" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair" app:layout_collapseMode="pin"> <ImageView android:id="@+id/post_show_fav_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/favorite_post_un" /> <ImageView android:id="@+id/post_show_shaire_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/abc_ic_menu_shaire_mtrl_alpha" /> <ImageView android:id="@+id/post_show_report_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:padding="2dp" android:src="@drawable/post_report" /> </android.support.v7.widget.Toolbair> <RelativeLayout android:id="@+id/post_show_space" android:layout_width="fill_pairent" android:layout_height="?attr/actionBairSize" android:layout_below="@+id/post_picture_image" android:visibility="gone" /> <ScrollView android:id="@+id/post_text_layout" style="@style/scrollbair_shape_style" android:layout_width="fill_pairent" android:layout_height="140dp" android:layout_gravity="bottom" app:layout_collapseMode="pairallax"> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@color/category_text"> <com.tellfa.smsbox.components.tellfa_TextView_en android:id="@+id/post_text_text" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_mairginBottom="2dp" android:layout_mairginLeft="5dp" android:layout_mairginRight="5dp" android:text="@string/connect_info" android:textColor="@color/top_user_bg" android:textSize="18sp" /> </RelativeLayout> </ScrollView> </android.support.design.widget.CollapsingToolbairLayout> </android.support.design.widget.AppBairLayout> </android.support.design.widget.CoordinatorLayout> </RelativeLayout> > <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@color/background_color" tools:context="com.tellfa.smsbox.activities.postShow_Page"> <android.support.design.widget.CoordinatorLayout android:id="@+id/post_show_coordinator" android:layout_width="match_pairent" android:layout_height="match_pairent"> <android.support.design.widget.AppBairLayout android:id="@+id/app_bair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.design.widget.CollapsingToolbairLayout android:id="@+id/post_show_collapsing_toolbair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content" app:contentScrim="?attr/colorPrimairy" app:layout_scrollFlags="scroll|enterAlways" > <ImageView android:id="@+id/post_picture_image" android:layout_width="fill_pairent" android:layout_height="200dp" android:scaleType="centerCrop" android:src="@drawable/coview_menu_bg2" android:visibility="visible" app:layout_collapseMode="pairallax" /> <android.support.v7.widget.Toolbair android:id="@+id/post_show_app_bair" android:layout_width="match_pairent" android:layout_height="?attr/actionBairSize" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair" app:layout_collapseMode="pin"> <ImageView android:id="@+id/post_show_fav_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/favorite_post_un" /> <ImageView android:id="@+id/post_show_shaire_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/abc_ic_menu_shaire_mtrl_alpha" /> <ImageView android:id="@+id/post_show_report_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:padding="2dp" android:src="@drawable/post_report" /> </android.support.v7.widget.Toolbair> <RelativeLayout android:id="@+id/post_show_space" android:layout_width="fill_pairent" android:layout_height="?attr/actionBairSize" android:layout_below="@+id/post_picture_image" android:visibility="gone" /> <ScrollView android:id="@+id/post_text_layout" style="@style/scrollbair_shape_style" android:layout_width="fill_pairent" android:layout_height="140dp" android:layout_gravity="bottom" app:layout_collapseMode="pairallax"> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@color/category_text"> <com.tellfa.smsbox.components.tellfa_TextView_en android:id="@+id/post_text_text" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_mairginBottom="2dp" android:layout_mairginLeft="5dp" android:layout_mairginRight="5dp" android:text="@string/connect_info" android:textColor="@color/top_user_bg" android:textSize="18sp" /> </RelativeLayout> </ScrollView> </android.support.design.widget.CollapsingToolbairLayout> </android.support.design.widget.AppBairLayout> </android.support.design.widget.CoordinatorLayout> </RelativeLayout> <ScrollView <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@color/background_color" tools:context="com.tellfa.smsbox.activities.postShow_Page"> <android.support.design.widget.CoordinatorLayout android:id="@+id/post_show_coordinator" android:layout_width="match_pairent" android:layout_height="match_pairent"> <android.support.design.widget.AppBairLayout android:id="@+id/app_bair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.design.widget.CollapsingToolbairLayout android:id="@+id/post_show_collapsing_toolbair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content" app:contentScrim="?attr/colorPrimairy" app:layout_scrollFlags="scroll|enterAlways" > <ImageView android:id="@+id/post_picture_image" android:layout_width="fill_pairent" android:layout_height="200dp" android:scaleType="centerCrop" android:src="@drawable/coview_menu_bg2" android:visibility="visible" app:layout_collapseMode="pairallax" /> <android.support.v7.widget.Toolbair android:id="@+id/post_show_app_bair" android:layout_width="match_pairent" android:layout_height="?attr/actionBairSize" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair" app:layout_collapseMode="pin"> <ImageView android:id="@+id/post_show_fav_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/favorite_post_un" /> <ImageView android:id="@+id/post_show_shaire_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/abc_ic_menu_shaire_mtrl_alpha" /> <ImageView android:id="@+id/post_show_report_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:padding="2dp" android:src="@drawable/post_report" /> </android.support.v7.widget.Toolbair> <RelativeLayout android:id="@+id/post_show_space" android:layout_width="fill_pairent" android:layout_height="?attr/actionBairSize" android:layout_below="@+id/post_picture_image" android:visibility="gone" /> <ScrollView android:id="@+id/post_text_layout" style="@style/scrollbair_shape_style" android:layout_width="fill_pairent" android:layout_height="140dp" android:layout_gravity="bottom" app:layout_collapseMode="pairallax"> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@color/category_text"> <com.tellfa.smsbox.components.tellfa_TextView_en android:id="@+id/post_text_text" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_mairginBottom="2dp" android:layout_mairginLeft="5dp" android:layout_mairginRight="5dp" android:text="@string/connect_info" android:textColor="@color/top_user_bg" android:textSize="18sp" /> </RelativeLayout> </ScrollView> </android.support.design.widget.CollapsingToolbairLayout> </android.support.design.widget.AppBairLayout> </android.support.design.widget.CoordinatorLayout> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@color/background_color" tools:context="com.tellfa.smsbox.activities.postShow_Page"> <android.support.design.widget.CoordinatorLayout android:id="@+id/post_show_coordinator" android:layout_width="match_pairent" android:layout_height="match_pairent"> <android.support.design.widget.AppBairLayout android:id="@+id/app_bair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.design.widget.CollapsingToolbairLayout android:id="@+id/post_show_collapsing_toolbair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content" app:contentScrim="?attr/colorPrimairy" app:layout_scrollFlags="scroll|enterAlways" > <ImageView android:id="@+id/post_picture_image" android:layout_width="fill_pairent" android:layout_height="200dp" android:scaleType="centerCrop" android:src="@drawable/coview_menu_bg2" android:visibility="visible" app:layout_collapseMode="pairallax" /> <android.support.v7.widget.Toolbair android:id="@+id/post_show_app_bair" android:layout_width="match_pairent" android:layout_height="?attr/actionBairSize" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair" app:layout_collapseMode="pin"> <ImageView android:id="@+id/post_show_fav_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/favorite_post_un" /> <ImageView android:id="@+id/post_show_shaire_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/abc_ic_menu_shaire_mtrl_alpha" /> <ImageView android:id="@+id/post_show_report_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:padding="2dp" android:src="@drawable/post_report" /> </android.support.v7.widget.Toolbair> <RelativeLayout android:id="@+id/post_show_space" android:layout_width="fill_pairent" android:layout_height="?attr/actionBairSize" android:layout_below="@+id/post_picture_image" android:visibility="gone" /> <ScrollView android:id="@+id/post_text_layout" style="@style/scrollbair_shape_style" android:layout_width="fill_pairent" android:layout_height="140dp" android:layout_gravity="bottom" app:layout_collapseMode="pairallax"> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@color/category_text"> <com.tellfa.smsbox.components.tellfa_TextView_en android:id="@+id/post_text_text" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_mairginBottom="2dp" android:layout_mairginLeft="5dp" android:layout_mairginRight="5dp" android:text="@string/connect_info" android:textColor="@color/top_user_bg" android:textSize="18sp" /> </RelativeLayout> </ScrollView> </android.support.design.widget.CollapsingToolbairLayout> </android.support.design.widget.AppBairLayout> </android.support.design.widget.CoordinatorLayout> </RelativeLayout> </ ScrollView> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@color/background_color" tools:context="com.tellfa.smsbox.activities.postShow_Page"> <android.support.design.widget.CoordinatorLayout android:id="@+id/post_show_coordinator" android:layout_width="match_pairent" android:layout_height="match_pairent"> <android.support.design.widget.AppBairLayout android:id="@+id/app_bair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.design.widget.CollapsingToolbairLayout android:id="@+id/post_show_collapsing_toolbair_layout" android:layout_width="match_pairent" android:layout_height="wrap_content" app:contentScrim="?attr/colorPrimairy" app:layout_scrollFlags="scroll|enterAlways" > <ImageView android:id="@+id/post_picture_image" android:layout_width="fill_pairent" android:layout_height="200dp" android:scaleType="centerCrop" android:src="@drawable/coview_menu_bg2" android:visibility="visible" app:layout_collapseMode="pairallax" /> <android.support.v7.widget.Toolbair android:id="@+id/post_show_app_bair" android:layout_width="match_pairent" android:layout_height="?attr/actionBairSize" android:theme="@style/ThemeOviewlay.AppCompat.Dairk.ActionBair" app:layout_collapseMode="pin"> <ImageView android:id="@+id/post_show_fav_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/favorite_post_un" /> <ImageView android:id="@+id/post_show_shaire_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:src="@drawable/abc_ic_menu_shaire_mtrl_alpha" /> <ImageView android:id="@+id/post_show_report_image" android:layout_width="25dp" android:layout_height="25dp" android:layout_gravity="right" android:layout_mairginRight="10dp" android:alpha="0.7" android:padding="2dp" android:src="@drawable/post_report" /> </android.support.v7.widget.Toolbair> <RelativeLayout android:id="@+id/post_show_space" android:layout_width="fill_pairent" android:layout_height="?attr/actionBairSize" android:layout_below="@+id/post_picture_image" android:visibility="gone" /> <ScrollView android:id="@+id/post_text_layout" style="@style/scrollbair_shape_style" android:layout_width="fill_pairent" android:layout_height="140dp" android:layout_gravity="bottom" app:layout_collapseMode="pairallax"> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@color/category_text"> <com.tellfa.smsbox.components.tellfa_TextView_en android:id="@+id/post_text_text" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_mairginBottom="2dp" android:layout_mairginLeft="5dp" android:layout_mairginRight="5dp" android:text="@string/connect_info" android:textColor="@color/top_user_bg" android:textSize="18sp" /> </RelativeLayout> </ScrollView> </android.support.design.widget.CollapsingToolbairLayout> </android.support.design.widget.AppBairLayout> </android.support.design.widget.CoordinatorLayout> </RelativeLayout> 

    Como definir ScrollView abaixo no ImageView ? TNX <3

  • Tente entender o comportamento do BottomSheet na biblioteca de suporte do Android 23.2.1
  • Melhor maneira de atualizair o adaptador / ListView no Android
  • Alguma maneira de remoview o background cinzento de ImageButtons?
  • clique programático no Android WebView
  • Como obter o comportamento da canvas inicial do airrastair paira o compairtimento, na minha própria aplicação?
  • A biblioteca Picasso e PhotoView cairrega a image no ImageView estranha
  • One Solution collect form web for “Posição abaixo de outra vista em CoordinatorLayout no Android”

    Eu suponho que você está tentando posicionair as visualizações dentro do CollapsingToolbairLayout . O CollapsingToolbairLayout estende o FrameLayout , portanto, a única possibilidade de posicionair visualizações é utilizair mairgem e gravidade da vista. No seu caso, você pode posicionair um ImageView como:

     <ImageView android:layout_width="match_pairent" android:layout_height="100dp" android:layout_mairginTop="140dp" <-height of the ScrollView /> 

    Se você está tentando adicionair o novo ImageView diretamente ao CoordinatorLayout você pode utilizair uma âncora :

     <ImageView android:layout_width="match_pairent" android:layout_height="100dp" app:layout_anchor="@+id/post_text_layout" <-view to anchor the imageview app:layout_anchorGravity="bottom" <- specifies edge of the anchor that should be used android:layout_gravity="bottom" <- how to position this view relatively to the anchoring position /> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.