我正在实现协调器布局以实现可滚动设计支持库,但无法看到具有适当高度的工具栏。我发布了我的布局文件。 我正在片段中使用这个布局并指导我关于我的错误...我哪里出错了。
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:myfont="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_home"
style="@style/Widget.MyApp.ActionBar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
android:fitsSystemWindows="false"
app:layout_collapseMode="pin"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/scrollviewHome"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="-5dp"
>
<!-- app:layout_behavior="@string/appbar_scrolling_view_behavior"-->
<RelativeLayout
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/White">
<RelativeLayout
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="180dp">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp" />
<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/titles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/lable_Category_Layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/top">
<com.itw.b2b.rapidcommv2.util.TextViewPlus
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/White"
android:gravity="left"
android:paddingLeft="5dp"
android:text="Our Products"
android:textColor="@color/Black"
android:textSize="20sp"
android:textStyle="bold"
myfont:customFont="@string/Roboto_Light" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/middle_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/lable_Category_Layout">
<GridView
android:id="@+id/custom_grid_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="5dp"
android:background="@color/White"
android:columnWidth="160dp"
android:horizontalSpacing="5dp"
android:isScrollContainer="false"
android:numColumns="2"
android:padding="5dp"
android:paddingBottom="10dp"
android:scrollbars="none"
android:verticalSpacing="10dp" />
</RelativeLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
<!-- For internet connection-->
<RelativeLayout
android:id="@+id/RelativeNoInterNetConnection"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone">
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/wifi" />
<com.itw.b2b.rapidcommv2.util.TextViewPlus
android:id="@+id/textViewErrorMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/imageView1"
android:layout_below="@+id/imageView1"
android:gravity="center"
android:text="@string/nointernetconnectionDescription"
android:textSize="15sp"
myfont:customFont="@string/Roboto_Light" />
<Button
android:id="@+id/button_referesh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textViewErrorMessage"
android:layout_centerHorizontal="true"
android:layout_marginTop="14dp"
android:text="Refresh" />
</RelativeLayout>
<ProgressBar
android:id="@+id/progressBarInternetConnection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<com.wangjie.rapidfloatingactionbutton.RapidFloatingActionLayout
xmlns:rfal="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main_rfal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
rfal:rfal_frame_alpha="0.7"
rfal:rfal_frame_color="#80000000"
android:layout_alignParentBottom="true"
>
<com.wangjie.rapidfloatingactionbutton.RapidFloatingActionButton
xmlns:rfab="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main_rfab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="15dp"
android:layout_marginRight="15dp"
android:padding="8dp"
rfab:rfab_color_normal="@color/list_background"
rfab:rfab_color_pressed="@color/list_background_pressed"
rfab:rfab_drawable="@drawable/rfab__drawable_rfab_default"
rfab:rfab_shadow_color="#999999"
rfab:rfab_shadow_dx="0dp"
rfab:rfab_shadow_dy="5dp"
rfab:rfab_shadow_radius="7dp"
rfab:rfab_size="normal"
/>
</com.wangjie.rapidfloatingactionbutton.RapidFloatingActionLayout>
</android.support.design.widget.CoordinatorLayout>
答案 0 :(得分:0)
工具栏只显示RunTime。