android - How to set an image to the really top of app? -
android - How to set an image to the really top of app? -
i seek set image top of android app.
but there space left/right/top if margin zero.
code:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="0dp" android:layout_marginbottom="0dp" android:layout_marginleft="0dp" android:layout_marginright="0dp" android:layout_marginstart="0dp" android:layout_margintop="0dp" android:background="@drawable/bgcolor" android:gravity="top" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <linearlayout android:id="@+id/topbar" android:layout_width="wrap_content" android:layout_height="wrap_content" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="25dp" android:src="@drawable/ic_launcher" />
where error? =)
check dimens.xml file (res/values directory) activity_vertical_margin
, activity_horizontal_margin
dimen
resources. using parent relativelayout
padding:
android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin"
android android-layout android-imageview
Comments
Post a Comment