我无法使用Collapsing工具栏和嵌套ScrollView来使用我的CoordinatorLayout。
在CoordinatorLayout之外的任何设置上设置fitssystemwindows =“true”没有或有负面影响。 App Theme具有属性
<item name="android:windowTranslucentStatus">true</item>
使状态栏透明。
我的问题是: 1.图像向下滚动太远,以便半透明状态栏采用蓝色工具栏颜色(当工具栏未100%展开时,ImageView可见)。
这是我的布局:
<android.support.design.widget.CoordinatorLayout 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_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.example.application.collapsingtoolbarexample.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="250dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/goslings"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#dfdddd"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="10dp"
>
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
<include layout="@layout/card_layout" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
答案 0 :(得分:0)
您需要适合系统窗口(工具栏除外),同时在图像上设置高度而不是CollapsingToolbar
Sub Test()
Dim primerRescateCP As Long
'Initialize the result to whatever it should be in case of error.
primerRescateCP = 0
'Attempt to get the actual value.
'If the attempt fails, it will be on the right hand side, before the assignment,
'leaving the variable untouched.
With Application.WorksheetFunction
On Error Resume Next
primerRescateCP = .Match(.VLookup("RescateCartera Propia", Range("B:B"), 1, 0), Columns(2), 0)
On Error GoTo 0
End With
'Display the result.
MsgBox primerRescateCP
End Sub
所以最终的代码是
android:fitsSystemWindows="true"