android setAlpha on imageView into CollapsingToolbarLayout does not work
<p>inside of CollapsingToolbarLayout imageview and i need setAlpha(float) When that scroll up and down:</p>

<p>this is method for get Offset and calculate float by offset:</p>

<p>AppBarLayout.OnOffsetChangedListener:</p>

<pre><code> @Override
    public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
        float offsetAlpha = (float) (verticalOffset / appBarLayout.getTotalScrollRange());
        imageView.setAlpha(offsetAlpha);
    }
</code></pre>

<p>xml layout:</p>

<pre><code> &lt;android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="50dp"
            android:fitsSystemWindows="true"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:contentScrim="@android:color/transparent"&gt;

      &lt;ImageView
                    android:id="@+id/imageView"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:scaleType="centerCrop"
                    app:layout_collapseMode="parallax" /&gt;

 &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
</code></pre>

<p>but setAlpha does not work. why?</p>