Image changes position with different devicesStrange out of memory issue while loading an image to a Bitmap objectLazy load of images in ListViewStandard Android Button with a different colorWhat is the difference between “px”, “dip”, “dp” and “sp”?Is there a unique Android device ID?What is the difference between gravity and layout_gravity in Android?Android GridView 3 x 6 Image CroppingWhat is the difference between match_parent and fill_parent?Android - tiled backgrounds occasionally get stretchedHow to change fontFamily of TextView in Android
Why should we care about syntactic proofs if we can show semantically that statements are true?
Acceptable to cut steak before searing?
Infeasibility in mathematical optimization models
Write an interpreter for *
Best way to divide CPU along all sql instances on 1 server
Why are Gatwick's runways too close together?
Does a code snippet compile? Or does it get compiled?
Generator for parity?
Dropdowns & Chevrons for Right to Left languages
Non-OR journals which regularly publish OR research
Drawing complex inscribed and circumscribed polygons in TikZ
How do we avoid CI-driven development...?
Can I call myself an assistant professor without a PhD?
Why doesn't the "ch" pronunciation rule occur for words such as "durch" and "manchmal"?
Performance of a branch and bound algorithm VS branch-cut-heuristics
Can I legally make a real mobile app based on a fictional app from a TV show?
How to vertically align the three columns of my table top, top, middle
Strangeness with gears
In reversi, can you overwrite two chips in one move?
How can you evade tax by getting employment income just in equity, then using this equity as collateral to take out loan?
Word or idiom defining something barely functional
Unique combinations of a list of tuples
How can I tell if a flight itinerary is fake?
A stranger from Norway wants to have money delivered to me
Image changes position with different devices
Strange out of memory issue while loading an image to a Bitmap objectLazy load of images in ListViewStandard Android Button with a different colorWhat is the difference between “px”, “dip”, “dp” and “sp”?Is there a unique Android device ID?What is the difference between gravity and layout_gravity in Android?Android GridView 3 x 6 Image CroppingWhat is the difference between match_parent and fill_parent?Android - tiled backgrounds occasionally get stretchedHow to change fontFamily of TextView in Android
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am working on an app that displays a parking lot and shows the available parking spots. However, I am having issues when showing the available parking spots in different devices. The background image is the sketch of a parking lot but and the parking spots are shown available by adding a red box on top of the parking spot. But the red boxes keep changing location as I use different devices.
First, this is my XML file where I upload the image in the background and set the location for some boxes that have to be placed on top of the background image.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Map.LotDisplay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:id="@+id/map"
android:orientation="horizontal"
android:background="@drawable/parkingmap">
</LinearLayout>
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="344dp"
android:layout_marginTop="250dp"
app:height="14dp"
app:width="33dp" />
<Spot
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/spot1"
app:height="14dp"
app:width="33dp"
android:layout_marginTop="266dp"
android:layout_marginLeft="344dp"/>
</RelativeLayout>
Here is how the image should be looking:
However, this is how it looks when I use a different device:
Can anyone tell me why is this happening and why to fix it? I thought using dp should solve the issue but it didn't.
This is parkingmap.png referenced in the XML file:
Thank you!
android android-layout
add a comment |
I am working on an app that displays a parking lot and shows the available parking spots. However, I am having issues when showing the available parking spots in different devices. The background image is the sketch of a parking lot but and the parking spots are shown available by adding a red box on top of the parking spot. But the red boxes keep changing location as I use different devices.
First, this is my XML file where I upload the image in the background and set the location for some boxes that have to be placed on top of the background image.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Map.LotDisplay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:id="@+id/map"
android:orientation="horizontal"
android:background="@drawable/parkingmap">
</LinearLayout>
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="344dp"
android:layout_marginTop="250dp"
app:height="14dp"
app:width="33dp" />
<Spot
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/spot1"
app:height="14dp"
app:width="33dp"
android:layout_marginTop="266dp"
android:layout_marginLeft="344dp"/>
</RelativeLayout>
Here is how the image should be looking:
However, this is how it looks when I use a different device:
Can anyone tell me why is this happening and why to fix it? I thought using dp should solve the issue but it didn't.
This is parkingmap.png referenced in the XML file:
Thank you!
android android-layout
1
That's by design-ish. the margins are constant, but the screen sizes are not. 300 dp margin places the image in a very different place on a 330dp wide device than a 700 dp wide device
– Zoe
Mar 21 at 16:19
You may try PercentRelativeLayout, this may help you "android.support.percent.PercentRelativeLayout"
– Fra Red
Mar 21 at 16:27
add a comment |
I am working on an app that displays a parking lot and shows the available parking spots. However, I am having issues when showing the available parking spots in different devices. The background image is the sketch of a parking lot but and the parking spots are shown available by adding a red box on top of the parking spot. But the red boxes keep changing location as I use different devices.
First, this is my XML file where I upload the image in the background and set the location for some boxes that have to be placed on top of the background image.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Map.LotDisplay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:id="@+id/map"
android:orientation="horizontal"
android:background="@drawable/parkingmap">
</LinearLayout>
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="344dp"
android:layout_marginTop="250dp"
app:height="14dp"
app:width="33dp" />
<Spot
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/spot1"
app:height="14dp"
app:width="33dp"
android:layout_marginTop="266dp"
android:layout_marginLeft="344dp"/>
</RelativeLayout>
Here is how the image should be looking:
However, this is how it looks when I use a different device:
Can anyone tell me why is this happening and why to fix it? I thought using dp should solve the issue but it didn't.
This is parkingmap.png referenced in the XML file:
Thank you!
android android-layout
I am working on an app that displays a parking lot and shows the available parking spots. However, I am having issues when showing the available parking spots in different devices. The background image is the sketch of a parking lot but and the parking spots are shown available by adding a red box on top of the parking spot. But the red boxes keep changing location as I use different devices.
First, this is my XML file where I upload the image in the background and set the location for some boxes that have to be placed on top of the background image.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Map.LotDisplay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:id="@+id/map"
android:orientation="horizontal"
android:background="@drawable/parkingmap">
</LinearLayout>
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="344dp"
android:layout_marginTop="250dp"
app:height="14dp"
app:width="33dp" />
<Spot
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/spot1"
app:height="14dp"
app:width="33dp"
android:layout_marginTop="266dp"
android:layout_marginLeft="344dp"/>
</RelativeLayout>
Here is how the image should be looking:
However, this is how it looks when I use a different device:
Can anyone tell me why is this happening and why to fix it? I thought using dp should solve the issue but it didn't.
This is parkingmap.png referenced in the XML file:
Thank you!
android android-layout
android android-layout
edited Mar 27 at 10:31
deadfish
6,97210 gold badges67 silver badges115 bronze badges
6,97210 gold badges67 silver badges115 bronze badges
asked Mar 21 at 16:13
Juan Ortiz CouderJuan Ortiz Couder
85 bronze badges
85 bronze badges
1
That's by design-ish. the margins are constant, but the screen sizes are not. 300 dp margin places the image in a very different place on a 330dp wide device than a 700 dp wide device
– Zoe
Mar 21 at 16:19
You may try PercentRelativeLayout, this may help you "android.support.percent.PercentRelativeLayout"
– Fra Red
Mar 21 at 16:27
add a comment |
1
That's by design-ish. the margins are constant, but the screen sizes are not. 300 dp margin places the image in a very different place on a 330dp wide device than a 700 dp wide device
– Zoe
Mar 21 at 16:19
You may try PercentRelativeLayout, this may help you "android.support.percent.PercentRelativeLayout"
– Fra Red
Mar 21 at 16:27
1
1
That's by design-ish. the margins are constant, but the screen sizes are not. 300 dp margin places the image in a very different place on a 330dp wide device than a 700 dp wide device
– Zoe
Mar 21 at 16:19
That's by design-ish. the margins are constant, but the screen sizes are not. 300 dp margin places the image in a very different place on a 330dp wide device than a 700 dp wide device
– Zoe
Mar 21 at 16:19
You may try PercentRelativeLayout, this may help you "android.support.percent.PercentRelativeLayout"
– Fra Red
Mar 21 at 16:27
You may try PercentRelativeLayout, this may help you "android.support.percent.PercentRelativeLayout"
– Fra Red
Mar 21 at 16:27
add a comment |
2 Answers
2
active
oldest
votes
Please try this one.Hope this will be work for multiple screen type
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/map"
android:orientation="horizontal"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_100sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spot
android:id="@+id/spot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_135sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
add this on Gradle file
implementation 'com.intuit.sdp:sdp-android:1.0.6'
Thank you! It didn't fully work but it guided me in the right direction!
– Juan Ortiz Couder
Apr 12 at 17:42
add a comment |
First of all I'm sorry that I'm posting this as an answer because I can't comment (I don't have the 50 reputations).
It's obvious that position will change because you are hardcoding layout_marginTop
and marginLeft
values, which should be generic for all devices.
But there is a solution, try this library android sdp .
This library will let you use sdp in the place of dp as a unit.
I hope this will help you.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284814%2fimage-changes-position-with-different-devices%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please try this one.Hope this will be work for multiple screen type
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/map"
android:orientation="horizontal"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_100sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spot
android:id="@+id/spot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_135sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
add this on Gradle file
implementation 'com.intuit.sdp:sdp-android:1.0.6'
Thank you! It didn't fully work but it guided me in the right direction!
– Juan Ortiz Couder
Apr 12 at 17:42
add a comment |
Please try this one.Hope this will be work for multiple screen type
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/map"
android:orientation="horizontal"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_100sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spot
android:id="@+id/spot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_135sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
add this on Gradle file
implementation 'com.intuit.sdp:sdp-android:1.0.6'
Thank you! It didn't fully work but it guided me in the right direction!
– Juan Ortiz Couder
Apr 12 at 17:42
add a comment |
Please try this one.Hope this will be work for multiple screen type
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/map"
android:orientation="horizontal"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_100sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spot
android:id="@+id/spot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_135sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
add this on Gradle file
implementation 'com.intuit.sdp:sdp-android:1.0.6'
Please try this one.Hope this will be work for multiple screen type
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/map"
android:orientation="horizontal"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Spot
android:id="@+id/spot0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_100sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spot
android:id="@+id/spot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_26sdp"
android:layout_marginBottom="@dimen/_135sdp"
android:layout_weight="1"
android:background="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
add this on Gradle file
implementation 'com.intuit.sdp:sdp-android:1.0.6'
edited Mar 27 at 9:48
answered Mar 27 at 7:38
DEVSHKDEVSHK
1841 silver badge5 bronze badges
1841 silver badge5 bronze badges
Thank you! It didn't fully work but it guided me in the right direction!
– Juan Ortiz Couder
Apr 12 at 17:42
add a comment |
Thank you! It didn't fully work but it guided me in the right direction!
– Juan Ortiz Couder
Apr 12 at 17:42
Thank you! It didn't fully work but it guided me in the right direction!
– Juan Ortiz Couder
Apr 12 at 17:42
Thank you! It didn't fully work but it guided me in the right direction!
– Juan Ortiz Couder
Apr 12 at 17:42
add a comment |
First of all I'm sorry that I'm posting this as an answer because I can't comment (I don't have the 50 reputations).
It's obvious that position will change because you are hardcoding layout_marginTop
and marginLeft
values, which should be generic for all devices.
But there is a solution, try this library android sdp .
This library will let you use sdp in the place of dp as a unit.
I hope this will help you.
add a comment |
First of all I'm sorry that I'm posting this as an answer because I can't comment (I don't have the 50 reputations).
It's obvious that position will change because you are hardcoding layout_marginTop
and marginLeft
values, which should be generic for all devices.
But there is a solution, try this library android sdp .
This library will let you use sdp in the place of dp as a unit.
I hope this will help you.
add a comment |
First of all I'm sorry that I'm posting this as an answer because I can't comment (I don't have the 50 reputations).
It's obvious that position will change because you are hardcoding layout_marginTop
and marginLeft
values, which should be generic for all devices.
But there is a solution, try this library android sdp .
This library will let you use sdp in the place of dp as a unit.
I hope this will help you.
First of all I'm sorry that I'm posting this as an answer because I can't comment (I don't have the 50 reputations).
It's obvious that position will change because you are hardcoding layout_marginTop
and marginLeft
values, which should be generic for all devices.
But there is a solution, try this library android sdp .
This library will let you use sdp in the place of dp as a unit.
I hope this will help you.
answered Mar 21 at 16:22
AmineAmine
1,0951 gold badge4 silver badges15 bronze badges
1,0951 gold badge4 silver badges15 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284814%2fimage-changes-position-with-different-devices%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
That's by design-ish. the margins are constant, but the screen sizes are not. 300 dp margin places the image in a very different place on a 330dp wide device than a 700 dp wide device
– Zoe
Mar 21 at 16:19
You may try PercentRelativeLayout, this may help you "android.support.percent.PercentRelativeLayout"
– Fra Red
Mar 21 at 16:27