I have several text views that take up the majority of the screen in landscape view in a relativelayout and the font size i have set is quite big (150dp). The text views are all timers and the furthest to the right is the "seco开发者_开发知识库nds" textview.
My problem is that when testing on a phone with a small screen res the seconds are way outside the limit of the screen and can't be seen. They are in perfect place on normal to large screen resolutions just not on a small screen.
Is there any way i can force the "seconds" text view to stay on screen, without adjusting the font size or margins between each text view? Even if it means looking cramped on a small screen i can live with that.
Any help is greatly appreciated.
Thanks
This is the corresponding code for the relative layout and linear layout containing the hour and minute text views
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:keepScreenOn="true" android:background="@drawable/background2">
<RelativeLayout android:id="@+id/RelativeLayout08"
android:paddingLeft="20dip" android:paddingRight="30dip"
android:background="@drawable/trans_img" android:layout_centerHorizontal="true"
android:paddingBottom="20dip" android:layout_centerVertical="true"
android:layout_height="wrap_content" android:layout_width="wrap_content">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true">
<TextView android:id="@+id/TextViewHr1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="5dip" android:gravity="right"
android:textColor="@color/white" android:textSize="150dp"
android:layout_marginLeft="5dip"></TextView>
<TextView android:id="@+id/TextViewHr2"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dip" android:layout_marginRight="5dip"
android:gravity="right" android:textColor="@color/white"
android:textSize="150dp"></TextView>
<TextView android:id="@+id/TextViewSeperate"
android:layout_width="wrap_content" android:layout_marginLeft="5dip"
android:layout_marginRight="5dip" android:layout_gravity="center_vertical"
android:background="@drawable/colon" android:layout_height="55dip"></TextView>
<TextView android:id="@+id/TextViewMin1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dip" android:layout_marginRight="5dip"
android:gravity="right" android:textColor="@color/white"
android:textSize="150dp"></TextView>
<TextView android:id="@+id/TextViewMin2"
android:layout_height="wrap_content" android:layout_marginLeft="5dip"
android:gravity="right" android:layout_width="wrap_content"
android:textColor="@color/white" android:textSize="150dp"
android:layout_marginRight="5dip"></TextView
</LinearLayout>
This is the code for the 2nd linear layout, within this relative layout 8:
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:layout_centerVertical="true"
android:layout_toRightOf="@+id/LinearLayout01" android:layout_marginLeft="20dip">
<TextView android:id="@+id/TextViewSeconds"
android:layout_height="wrap_content" android:text="20"
android:layout_marginTop="5dip" android:textColor="@color/white"
android:textSize="55dip" android:layout_width="wrap_content"></TextView>
I would try setting layout_weight settings.
To do it try following: set in parent weight_sum = "1.0"
And in child percentage value, how much space they need to take i.e. layout_weight="0.8" and layout_weight="0.2", remember to set layout_width = "0dp" in all elements in parent.
精彩评论