0

I'm trying to get this ImageView to display at the bottom right corner of the screen in a relative Layout.

To create the layout file, I used Android Studio's design view (the tab that says 'design' while viewing the layout file), and dragged and resized the image there to the point where I got it how I wanted. However, on a real phone, when the app is installed, the image simply does not show up.

<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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"        
tools:context=".HomeActivityFragment"
android:id="@+id/layout"
android:clickable="false">

<ImageView
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:id="@+id/imageView"
    android:layout_gravity="bottom|right"
    android:layout_marginRight="20dp"
    android:src="@drawable/action_black"
    android:layout_marginEnd="20dp"
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:layout_marginBottom="20dp"
    android:layout_alignParentStart="false" />
</RelativeLayout>
Jatinshravan
  • 435
  • 3
  • 16
  • It should show up, but keep in mind that 50dp is going to be a different size between devices, Take a look at this:http://stackoverflow.com/questions/29956014/why-should-we-use-xml-layouts – Nanoc Nov 27 '15 at 14:36
  • Okay, I changed the padding and that didn't work. This code was the layout for my fragment. I moved this entire code to my activity, and lo behold it was appearing fine... I have no idea still – Jatinshravan Nov 27 '15 at 14:52
  • Then your problem is with the fragment – Nanoc Nov 27 '15 at 14:55
  • How the screen actually shown in mobile? – iSrinivasan27 Nov 27 '15 at 15:06

0 Answers0