2011-02-17 2 views
0

나는 대부분의 텍스트보기가 상대방보기의 가로보기에서 화면을 차지하고 있으며 글꼴 크기는 상당히 큽니다 (150dp). 텍스트보기는 모두 타이머이고 가장 오른쪽은 "초"텍스트보기입니다.작은 화면에서 안드로이드 폰 글꼴보기

내 문제는 작은 화면 해상도의 휴대 전화에서 테스트 할 때 초가 화면 한도를 벗어나서 보이지 않는다는 것입니다. 작은 화면이 아닌 일반 화면에서 큰 화면까지 완벽한 해상도를 제공합니다.

각 텍스트보기 사이의 글꼴 크기 나 여백을 조정하지 않고도 "초"텍스트보기를 화면에 표시 할 수있는 방법이 있습니까? 작은 화면에서 비좁은 곳을 보더라도 그 곳에서 살 수 있습니다.

도움을 주시면 대단히 감사하겠습니다.

감사

이 시분 텍스트 뷰

<?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> 

이 함유 상대 배치 및 선형 레이아웃에 대응하는 코드는이 상대 배치 8에서, 제 2 선형 레이아웃의 코드 :

<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> 

답변

0

layout_weight 설정을 시도해 보겠습니다.

그것은 다음과 같은 시도하려면 : 부모의 세트를 weight_sum을 = "1.0"

그리고 아동 비율 값이, 얼마나 많은 공간을 그들이 수행해야 즉 에 layout_weight = "0.8"에 layout_weight = "0.2", 부모의 모든 요소에 layout_width = "0dp"을 설정해야합니다.

+0

감사합니다. 모든 textviews가 포함 된 상대 레이아웃에 대해 weight_sum = 1.0을 설정하고 그 다음에 "초"텍스트 뷰가 잘리는 경우 가중치 = 0.2를 설정한다는 뜻입니까? 또한 상대 레이아웃의 너비를 0dp로 설정하면 엉망이되지 않을까요? 그것에 대한 backgroung으로 다시 감사합니다 – user581949

+0

그것은 엉망이되지 않습니다. layout_weight 뷰를 사용하면 화면의 백분율 값에 맞게 그려 지므로 0.8에서는 화면의 80 %가됩니다. 이것은 다른 화면 크기의 문제를 처리하는 방법입니다. – Patrick

+0

이 방법을 시도했지만 어떤 이유로 그것을 작동시키지 못했습니다. 그래서 두 개의 선형 레이아웃이 포함 된 상대 레이아웃이 있습니다. 첫 번째 선형 레이아웃에는 시간 및 분 텍스트보기가 포함되고 두 번째 줄에는 초 텍스트보기가 포함됩니다. android : layout_weight = "0.8"을 설정하고 선형 레이아웃 2 (초)에 대해 android : layout_weight = "1.0"을 적용하여 선형 레이아웃 1 (시간 및 분 포함) 0.2 "이다. 두 선형 레이아웃 모두 layout_width = "0dp"로 설정했습니다. 나는 명확한 설명을 호소합니다. 감사합니다. – user581949

관련 문제