android - How to fit an image in to screen? -
i have xml code ,i want fit image full screen size,i have code ,but dint need.can me? new android ,any other possible ways this? me please
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"/> <imageview android:layout_width="match_parent" android:layout_height="match_parent" android:adjustviewbounds="true" android:scaletype="fitxy" android:id="@+id/imageview" />
<android.support.v4.view.viewpager xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent"> </android.support.v4.view.viewpager> class custompageradapter extends pageradapter { context mcontext; layoutinflater mlayoutinflater; int[] mresources = { r.drawable.first, r.drawable.second, r.drawable.third, r.drawable.fourth, r.drawable.fifth, r.drawable.sixth };
remove :
android:adjustviewbounds="true"
its used if want imageview adjust bounds preserve aspect ratio of drawable.
Comments
Post a Comment