I have programmatically added collapsingToolbarLayout. For some reason, I do not see the height, either in its collapsed or in an expanded state. I tried the following to no avail:
Resources r = getResources();
AppBarLayout appBarLayout = (AppBarLayout)collapsingToolbarLayout.getParent();
/* none of these work */
ViewCompat.setElevation(collapsingToolbarLayout,r.getDimension(R.dimen.toolbar_elevation));
ViewCompat.setElevation(appBarLayout, r.getDimension(R.dimen.toolbar_elevation));
ViewCompat.setElevation(getPrimaryToolbar(), r.getDimension(R.dimen.toolbar_elevation));
Will there be a reason for this?
source
share