Hello i make my first app in the Android Studio and i have some problem. I was read every stackoverflow's topics and android documentation about my problem but i still don't understand what i should do.
I uses a ConstraintLayout for application and uses "SDP" "SSP" library for different screen sizes. In the Android Studio preview on every devices (also my custom device) my app looks good
screenshoot
But when i test app on my phone (the same phone like a device in Android Studio "LG") the app isn't the same like in the preview
screenshoot
Like you can see some elements are disappear
What should I do to make the application on the phone look the same as in the preview and to be adapted to different devices and screen sizes?'
Here's my XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:background="#ff11111a"
android:theme="#style/Theme.PlayRPGMobile"
tools:context=".MainActivity">
<ImageView
android:id="#+id/imageView"
android:layout_width="#dimen/_230sdp"
android:layout_height="#dimen/_300sdp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/login_logo"
app:layout_constraintVertical_bias="0.299"
app:srcCompat="#drawable/rectangle" />
<ImageView
android:id="#+id/login_logo"
android:layout_width="#dimen/_300sdp"
android:layout_height="0dp"
android:layout_marginTop="#dimen/_64sdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.476"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/logo" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_28sdp"
android:fontFamily="sans-serif-medium"
android:text="Wprowadź swoje dane"
android:textSize="#dimen/_15ssp"
app:layout_constraintBottom_toTopOf="#+id/loginEdit"
app:layout_constraintEnd_toEndOf="#+id/imageView"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="#+id/imageView"
app:layout_constraintTop_toTopOf="#+id/imageView"
app:layout_constraintVertical_bias="0.0"
tools:text="Wprowadź swoje dane" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_24sdp"
android:fontFamily="sans-serif-medium"
android:text="Play RPG © 2022"
android:textSize="#dimen/_15ssp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView"
tools:text="Play RPG © 2022" />
<EditText
android:id="#+id/loginEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_80sdp"
android:background="#ff222228"
android:ems="10"
android:hint="Login..."
android:inputType="textPersonName"
android:minHeight="#dimen/_38sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingTop="#dimen/_5sdp"
android:paddingBottom="#dimen/_2sdp"
app:layout_constraintEnd_toEndOf="#+id/imageView"
app:layout_constraintHorizontal_bias="0.533"
app:layout_constraintStart_toStartOf="#+id/imageView"
app:layout_constraintTop_toTopOf="#+id/imageView" />
<EditText
android:id="#+id/passEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_20sdp"
android:background="#ff222228"
android:ems="10"
android:hint="Hasło..."
android:inputType="textPassword"
android:minHeight="#dimen/_38sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingTop="#dimen/_5sdp"
android:paddingBottom="#dimen/_5sdp"
app:layout_constraintEnd_toEndOf="#+id/loginEdit"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="#+id/loginEdit"
app:layout_constraintTop_toBottomOf="#+id/loginEdit" />
<Button
android:id="#+id/loginBtn"
android:layout_width="#dimen/_130sdp"
android:layout_height="#dimen/_38sdp"
android:backgroundTint="#ff222228"
android:fontFamily="sans-serif-medium"
android:text="Zaloguj"
android:textColor="#color/white"
app:layout_constraintBottom_toBottomOf="#+id/imageView"
app:layout_constraintEnd_toEndOf="#+id/pinEdit"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="#+id/pinEdit"
app:layout_constraintTop_toBottomOf="#+id/pinEdit"
app:layout_constraintVertical_bias="0.512" />
<EditText
android:id="#+id/pinEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_20sdp"
android:background="#ff222228"
android:ems="10"
android:hint="PIN..."
android:inputType="number"
android:minHeight="#dimen/_38sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingTop="#dimen/_5sdp"
android:paddingBottom="#dimen/_5sdp"
app:layout_constraintEnd_toEndOf="#+id/passEdit"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="#+id/passEdit"
app:layout_constraintTop_toBottomOf="#+id/passEdit" />
</androidx.constraintlayout.widget.ConstraintLayout>
For making responsive UI I would suggest using guidelines in constraint layout. You can take help of this constraint layout training guide.
Also you can make use of chains in constraint layout Chains
Avoid hard-coded layout sizes for Different Screen Sizes
To ensure that your layout is flexible and adapts to different screen sizes, you should use wrap_content or match_parent for the width and height of most view components, instead of hard-coded sizes.
wrap_content tells the view to set its size to whatever is necessary to fit the content within that view.
match_parent makes the view expand to as much as possible within the parent view.
It would be helpful for you to look at the Android documentation.
Use guidelines and constraint the views to it. I faced the same problem and guidelines helped me a lot.
Related
I'm using Autosizing TextViews, but sometimes it has a space line in the bottom of text view. Anyone know this?
<TextView
android:background="#color/colorGrayAlto"
app:autoSizeMaxTextSize="27sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeStepGranularity="2sp"
app:autoSizeTextType="uniform"
android:id="#+id/tvVerse"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="130dp"
android:fontFamily="#font/azbuka_pro"
android:gravity="center|top"
android:lineSpacingExtra="3dp"
android:paddingHorizontal="40dp"
android:textSize="27sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="The follower of the law, even if he can recite only a small portion (of the law), but, having forsaken passion and hatred and foolishness, possesses true knowledge and serenity of mind, he, caring for nothing in this world or that to come, has indeed a share in the priesthood." />
This is because you have defined gravity with
android:gravity="center|top"
It sticks the text to top only.
Try to change it as following-
android:gravity="center"
Try this :-
<LinearLayout
android:background="#color/colorGrayAlto"
android:layout_width="match_parent"
android:layout_marginTop="130dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_height="wrap_content">
<TextView
app:autoSizeMaxTextSize="27sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeStepGranularity="2sp"
app:autoSizeTextType="uniform"
android:id="#+id/tvVerse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/azbuka_pro"
android:gravity="center|top"
android:lineSpacingExtra="3dp"
android:paddingHorizontal="40dp"
android:textSize="27sp"
tools:text="The follower of the law, even if he can recite only a small portion (of the law), but, having forsaken passion and hatred and foolishness, possesses true knowledge and serenity of mind, he, caring for nothing in this world or that to come, has indeed a share in the priesthood." />
</LinearLayout>
Using ConstraintLayout I saw this problem: on phones, the resolution of my widgets is normal and takes up almost all of the
screen space:
But when I switch to the resolution of the tablets, all the widgets become small and cannot be viewed on the screen:
How to make the resolution of widgets look normal on all resolutions and devices?
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TableLayout
android:id="#+id/table_l"
android:layout_width="297dp"
android:layout_height="329dp"
android:layout_weight="1"
android:layout_x="57dp"
android:layout_y="202dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
</TableRow>
</TableLayout>
<Button
android:id="#+id/st"
android:layout_width="178dp"
android:layout_height="wrap_content"
android:layout_x="120dp"
android:layout_y="112dp"
android:text="start"
app:layout_constraintBottom_toTopOf="#+id/table_l"
app:layout_constraintEnd_toEndOf="#+id/table_l"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="#+id/table_l"
app:layout_constraintTop_toTopOf="parent"
android:layout_weight="1"
app:layout_constraintVertical_bias="0.647" />
<TextView
android:id="#+id/X_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="48dp"
android:layout_x="118dp"
android:layout_y="608dp"
android:text="x:"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/O_text"
app:layout_constraintStart_toStartOf="#+id/O_text"
app:layout_constraintTop_toBottomOf="#+id/O_text" />
<TextView
android:id="#+id/O_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:layout_x="116dp"
android:layout_y="661dp"
android:text="o:"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/table_l"
app:layout_constraintHorizontal_bias="0.153"
app:layout_constraintStart_toStartOf="#+id/table_l"
app:layout_constraintTop_toBottomOf="#+id/table_l"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/textView3"
android:layout_width="27dp"
android:layout_height="47dp"
android:layout_marginTop="36dp"
android:textSize="36sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.139"
app:layout_constraintStart_toEndOf="#+id/O_text"
app:layout_constraintTop_toBottomOf="#+id/table_l"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/textView4"
android:layout_width="25dp"
android:layout_height="45dp"
android:layout_marginBottom="52dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.151"
app:layout_constraintStart_toEndOf="#+id/X_text"
app:layout_constraintTop_toBottomOf="#+id/textView3"
app:layout_constraintVertical_bias="0.571" />
</androidx.constraintlayout.widget.ConstraintLayout>
You should create layout xml files for different screen size. For example; If your app running in Tablet(7 inch), you must create new layout as a layout-sw600dp.
Look at this link for more details.
You should stop using fixed sizes and x/y positions for layouts. There might be exceptions, but in general, all views should be able to dynamically resize themselves. That means, you almost never use fixed values for widths but instead wrap_content or match_parent. After 4 years of android development I also have to find one case where I ever needed the layout_x and layout_y XML tags.
Otherwise, this layout will be small on big screens and it won't fit on small screens.
For 90% of layouts, all you need is ConstraintLayout and maybe LinearLayout. RelativeLayouts have become mostly obsolete.
Explaining how to properly arrange your ui would be to exhaustive here. Instead, I recommend you to take the time to go through a tutorial like this google codelab on building a responsive UI with constraintlayouts. If done correctly, you can build one UI which looks good an smartphones and tablets.
But if you want to have an entirely different layout for tablets, then #Mustafa Yanık's approach is correct. Then you need to create a second layout in a different subfolder.
I am currently facing a trouble regarding size change.
I have coded my xml files using dp's, but when I change the device screen size, the layout would change.
For example, when I go into Settings - Display - Screen zoom and font and set screen zoom from medium to large, some of the elements in my layout such as imageview or button would grow and go beyond the screen.
Since I'm using a complex layout containing LinearLayouts and FrameLayouts, I am not clear about how I should make this layout look alright in any other devices or screen sizes. It seems like when I change the screen zoom setting, the value of dp changes.
Is there a way to avoid this problem, or maybe to programmatically set screen zoom setting to medium?
Here is my code:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_gravity="center"
android:layout_marginTop="65dp">
<android.support.constraint.ConstraintLayout
android:id="#+id/frameLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="95dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.3">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/home_map" />
<Button
android:id="#+id/pick1"
android:layout_width="34dp"
android:layout_height="56dp"
android:background="#drawable/top_deselected"
app:layout_constraintBottom_toBottomOf="#+id/imageView"
app:layout_constraintEnd_toEndOf="#+id/imageView"
app:layout_constraintHorizontal_bias="0.17"
app:layout_constraintStart_toStartOf="#+id/imageView"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.18" />
<Button
android:id="#+id/pick2"
android:layout_width="34dp"
android:layout_height="56dp"
android:background="#drawable/jungle_deselected"
app:layout_constraintBottom_toBottomOf="#+id/imageView"
app:layout_constraintEnd_toEndOf="#+id/imageView"
app:layout_constraintHorizontal_bias="0.28"
app:layout_constraintStart_toStartOf="#+id/imageView"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.367" />
<Button
android:id="#+id/pick3"
android:layout_width="34dp"
android:layout_height="56dp"
android:background="#drawable/mid_deselected"
app:layout_constraintBottom_toBottomOf="#+id/imageView"
app:layout_constraintEnd_toEndOf="#+id/imageView"
app:layout_constraintHorizontal_bias="0.424"
app:layout_constraintStart_toStartOf="#+id/imageView"
app:layout_constraintTop_toTopOf="#+id/imageView"
app:layout_constraintVertical_bias="0.43" />
<Button
android:id="#+id/pick4"
android:layout_width="34dp"
android:layout_height="56dp"
android:background="#drawable/support_deselected"
app:layout_constraintBottom_toBottomOf="#+id/imageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.615"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/imageView"
app:layout_constraintVertical_bias="0.71" />
<Button
android:id="#+id/pick5"
android:layout_width="34dp"
android:layout_height="56dp"
android:background="#drawable/adc_deselected"
app:layout_constraintBottom_toBottomOf="#+id/imageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.733"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/imageView"
app:layout_constraintVertical_bias="0.71" />
</android.support.constraint.ConstraintLayout>
<Button
android:layout_width="335dp"
android:layout_height="42.5dp"
android:layout_marginBottom="5.5dp"
android:background="#drawable/home_mode"
android:id="#+id/home_mode"/>
<Button
android:layout_width="335dp"
android:layout_height="42.5dp"
android:background="#drawable/home_match"
android:id="#+id/home_match"/>
</LinearLayout>
The constraint layout used to be a frame layout, but I was just now trying out the constraint layout.
You can also use this library, it is working on all devices, no need to make any dimen file and all. but use this only for the size of widgets, for text size use "sp" only.
https://github.com/intuit/sdp
I am creating my first app with android studio and this is my first problem:
I want to try the ConstraintLayout. I have built the layout with a ConstraintLayout with the Design Editor (clicking it together). When i try the layout in Android Emulator, all Buttons have moved in the left upper corner :(
Except the "Hello World" Label which was generated automatically when i created my first project.
The difference between the Label and the Button is, that some code lines beginning with app:layout_constraint.... are missing. You can see it in Code.
What am I doing wrong, or is it a bug?
I would be glad for an answer! :)
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context="com.example.u0017007.coffeecounter.MainActivity">
<TextView
android:layout_width="136dp"
android:layout_height="30dp"
android:text="Hello World!"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.234" />
<Button
android:id="#+id/buttonAddCoffee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:freezesText="false"
android:text="#string/add_coffee"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="231dp" />
<Button
android:id="#+id/buttonRemoveCoffee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/remove_coffee"
tools:layout_editor_absoluteX="236dp"
tools:layout_editor_absoluteY="231dp" />
</android.support.constraint.ConstraintLayout>
tools:layout_editor_absoluteX and tools:layout_editor_absoluteY are only used for preview, like all tools:XXXX.
You need to add constraints to your view. You can add in the XML or you can do it with the visual editor.
There is a very good website that explain all about ConstraintsLayout.
By the way, Android Studio warm you with a error This view is not constrained, it only has designtime positions, so it will jump to (0,0) unless you add constraints if you don't set constraints.
It seems from the above code that, you didn't added any constraints to buttons thats why they moved to left upper corner.
<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">
<TextView
android:layout_width="136dp"
android:layout_height="30dp"
android:text="Hello World!"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.234" />
<Button
android:id="#+id/buttonAddCoffee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:freezesText="false"
android:text="ADD coffee"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="276dp"
app:layout_constraintRight_toLeftOf="#+id/buttonRemoveCoffee"
android:layout_marginRight="82dp"
android:layout_marginLeft="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintHorizontal_bias="1.0" />
<Button
android:id="#+id/buttonRemoveCoffee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="remove coffee"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="276dp"
android:layout_marginRight="24dp"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
Please refer to bellow link -
https://www.youtube.com/watch?v=z53Ed0ddxgM
tools:layout_editor_absoluteX="236dp"
tools:layout_editor_absoluteY="231dp"
These are used by studio to render in Graphic editor only. During run time,
as constraints are not set, the views take default position(0,0).
Try setting some constraints on buttons and procedd
I make UI of many buttons to input text by constraint layout.
For example, the following image.
But,I feel strange that android studio become very slow as I put more UIs and adaptive hook allows I set, sometimes disappear(ex.some buttons' allow disapper head row above image).It should use very large memory and I guess free memory to calculate position and re-render UI.
Can I avoid this situation? or Alternative way to make same UI using another layout. I'm very nervous for this problem because I can't understand the best way to make grid flexible-scaling UI.Any tips will help me.
I could solve the problem using grid layout enclosing the buttons nested constraint view and it seem best way that relative positioning UI.
<?xml version="1.0" encoding="utf-8"?>
<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">
<EditText
android:layout_width="456dp"
android:layout_height="64dp"
android:inputType="textPersonName"
android:text="Name"
android:ems="10"
android:id="#+id/editText"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="16dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginEnd="16dp"
app:layout_constraintRight_toRightOf="parent" />
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:columnCount="8"
android:rowCount="5"
android:useDefaultMargins="true"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="32dp"
android:foregroundGravity="center_horizontal"
android:layout_marginStart="16dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginEnd="16dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/editText"
app:layout_constraintVertical_bias="0.81">
<Button
android:text="button"
android:layout_width="88dp"
android:background="#drawable/oval_btn"
android:id="#+id/str_wa"
android:layout_height="88dp"
tools:layout_editor_absoluteY="520dp"
tools:layout_editor_absoluteX="529dp" /> ・・・・・・
And you can place what you like.