【发布时间】:2018-03-28 18:57:41
【问题描述】:
我正在开发 android 应用程序并使用 eclipse。我在两个选项卡上运行此应用程序,一个选项卡的屏幕尺寸 id 没问题,但在其他选项卡中,屏幕尺寸不适合设备,图标也更大。我是这方面的初学者,有没有办法使用以下方式解决这个问题?
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
和<supports-screens android:xlargeScreens="true"/>
我需要更改 Manifest 文件吗?
还是要对布局进行任何更改?
这是我的 xml 之一
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:background="@drawable/background6">
<TableRow
android:id="@+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="1dp" >
</TableRow>
<TableRow
android:id="@+id/tableRow18"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/lblNICBRAdvRcpt"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:text="NIC/BR No :"
android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="#515152"/>
<EditText
android:id="@+id/txtNICBRAdvRcpt"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:inputType="textCapCharacters"
android:tag="txt"
android:maxLength="30"
android:maxLines="1" />
<TextView
android:id="@+id/lblCustomerType"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:text="Customer Type :"
android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="#515152"
/>
<Spinner
android:id="@+id/spinCustomerType"
android:layout_width="200dp"
android:layout_height="50dp"
android:background="@drawable/spnbg" />
<!--some code here -->
</TableRow>
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
【问题讨论】: