android - Crop view from top instead of bottom -


i want view cropped top instead bottom when doesn't fit container. layout:

<framelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="wrap_content"     android:layout_height=“100dp”      <view         android:id="@+id/my_view"         android:layout_width="match_parent"         android:layout_height=“80dp">  </framelayout> 

now bottom 20dp of my_view cropped. should crop top 20dp of my_view instead of bottom part?

you can using layout gravity of view

<framelayout xmlns:android="http://schemas.android.com/apk/res/android"          android:layout_width="wrap_content"          android:background="#ffffff"          android:layout_height="100dp">  <view     android:id="@+id/my_view"     android:layout_width="match_parent"     android:layout_gravity="bottom"     android:background="#000000"     android:layout_height="80dp"/> 


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -