크기 나는 다음과 같은 레이아웃을 가지고 : 텍스트가 약 차지하게, 위 그림과 같이 20sp하는 텍스트 크기를 설정 내 넥서스 5에서안드로이드 - 텍스트 크기 모든 화면에서 동일한 내 안드로이드 응용 프로그램에서
<android.support.v7.widget.CardView
android:id="@+id/difficultyCardView"
app:layout_widthPercent="60%"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:cardUseCompatPadding="true"
android:layout_centerHorizontal="true"
android:layout_above="@+id/noHighScoresCardView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/yellow"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"
android:src="@drawable/pushpin" />
<TextView
android:id="@+id/diffNameTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="12dp"
android:maxLines="1"
android:singleLine="true"
android:text="FÁCIL"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
</android.support.v7.widget.CardView>
을, , CardView 너비의 75 %. 문제는 작은 전화기에서 이것을 테스트 할 때 텍스트에 줄임표가 추가된다는 것입니다.
내가 원하는 것은, 모든 화면 크기와 해상도에서 텍스트가 카드의 75 %를 정확히 차지한다는 것입니다.
그래서이 문제를 해결하고 여러 개의 축척 폴더 (ldpi, mdpi, ...)를 만들고 각각의 글꼴 크기를 조정하거나 코드를 통해 백분율로 계산하거나 다른 해결책을 사용하려면 어떻게해야합니까?
감사합니다.
내 앱이 스페인어와 영어로 모두 현지화되어 있으므로 텍스트가 항상 동일하지는 않습니다. – fergaral