joao.sauer
Lurker
Hello Guys!
It's my first post here and I hope that it will not be the last one!
First of all, I already programmed for android, but using absoluteLayout (it's so simple!
), now, I'm moving to dynamic positions for obvious reasons (We don't have just few screen sizes now and the future Android's "ipad" are starting to appear with huge screens).
So, my concern here is to understand and work with LinearLayouts. I tried to use the RelativeLayout, but everybody told me to start with the LinearLayouts, because it's simple.
What I just want to do it to put some texts in the screen, together with a border that I'm doing(this border will be in the entire screen.)
The problem is that the LinearLayout is adding some texts to OUTSIDE of the screen, and this I cannot understand why. Why the LinearLayout cannot just keep the elements in the screen size, even if will be very small sizes.
take a look:
where horizontal_bar is a image with 6x4 and vertical_bar is a image with 4x6.
This image needs to be stretch to be able to became a border.
Any idea why the LinearLayout is going out of the screen size?
Thanks a lot for your help,
Joao
It's my first post here and I hope that it will not be the last one!

First of all, I already programmed for android, but using absoluteLayout (it's so simple!
), now, I'm moving to dynamic positions for obvious reasons (We don't have just few screen sizes now and the future Android's "ipad" are starting to appear with huge screens).So, my concern here is to understand and work with LinearLayouts. I tried to use the RelativeLayout, but everybody told me to start with the LinearLayouts, because it's simple.
What I just want to do it to put some texts in the screen, together with a border that I'm doing(this border will be in the entire screen.)
The problem is that the LinearLayout is adding some texts to OUTSIDE of the screen, and this I cannot understand why. Why the LinearLayout cannot just keep the elements in the screen size, even if will be very small sizes.
take a look:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background = "@color/White">
<ImageView android:layout_height="wrap_content" android:minHeight="2px" android:maxHeight="2px" android:layout_gravity= "top" android:src = "@drawable/horizontal_bar" android:scaleType = "fitXY" android:layout_weight="1" android:layout_width="fill_parent"/>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1">
<ImageView android:src = "@drawable/vertical_bar" android:minWidth="2px" android:maxWidth="2px" android:scaleType = "fitXY" android:layout_gravity= "left" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/>
<TextView android:text="testing" android:layout_height="fill_parent" android:layout_width="fill_parent" android:paddingLeft="15px" android:textStyle="bold" android:textColor="@color/grey" android:textSize="20px" android:layout_weight="1" android:layout_gravity="center_horizontal|center"/>
<TextView android:text="blablabla" android:layout_height="fill_parent" android:layout_width="fill_parent" android:paddingLeft="15px" android:textStyle="bold" android:textColor="@color/grey" android:textSize="20px" android:layout_weight="1" android:layout_gravity="center_horizontal|center"/>
<TextView android:text="0000" android:id="@+id/number" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_gravity="left" android:textStyle="bold" android:textColor="@color/green" android:textSize="20px" android:layout_weight="1"/>
<ImageView android:src = "@drawable/vertical_bar" android:minWidth="2px" android:maxWidth="2px" android:scaleType = "fitXY" android:layout_gravity= "right" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/>
</LinearLayout>
<ImageView android:layout_height="wrap_content" android:minHeight="2px" android:maxHeight="2px" android:layout_gravity= "top" android:src = "@drawable/horizontal_bar" android:scaleType = "fitXY" android:layout_weight="1" android:layout_width="fill_parent"/>
</LinearLayout>
This image needs to be stretch to be able to became a border.
Any idea why the LinearLayout is going out of the screen size?
Thanks a lot for your help,
Joao