私はアンドロイドアプリケーションを開発しています。Androidでテキストがどのように表示されるかについて、誰かに教えてもらったり、リンクを送ってもらえませんか。画像に関する限り、サイズを dp で指定して、サイズを一定に保つことができます。Android でこれを行うには、デバイス間で読み取り可能なままにする方法を教えてください。
2 に答える
2
SP 単位を使用してテキスト サイズを指定します。
同様に、sp (スケールに依存しないピクセル) を使用してテキスト サイズを定義する必要があります。sp 倍率はユーザー設定に依存し、システムは dp の場合と同じようにサイズを調整します。
複数画面のサポートについては、Android のドキュメントを参照してください。
于 2012-07-31T12:25:35.380 に答える
0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/textViewOrderProduct"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginLeft="5dp"
android:onClick="hideKeyBord"
android:text="123"
android:textSize="15dp"
android:width="100dp" />
<EditText
android:id="@+id/editTextOrderQty"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="8dp"
android:background="#ffffff"
android:inputType="number"
android:maxLength="4"
android:text="123"
android:textSize="13dp"
android:width="50dp" />
<EditText
android:id="@+id/editTextOrderprice"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="8dp"
android:background="#ffffff"
android:inputType="number"
android:maxLength="5"
android:text="123"
android:textSize="13dp"
android:width="50dp" />
<TextView
android:id="@+id/textViewOrderStock"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginLeft="5dp"
android:onClick="hideKeyBord"
android:text="123"
android:textSize="13dp"
android:width="50dp" />
</LinearLayout>
于 2012-07-31T12:23:45.317 に答える