Я думаю, что у вас неправильный подход к использованию ListView. Используйте адаптер для подачи списка в представление, и в файле макета ListView вы не определяете строки, вы только определяете само представление списка и текстовое представление по умолчанию, которое будет отображаться, когда в списке нет элементов. Затем вы определяете отдельный XML-файл, который будет отображать каждую строку. Тогда в этом макете строки вы можете установить желаемый размер текста.
Вот пример списка XML (обратите внимание на специальный идентификатор, предоставленный списку и текстовому обзору, они необходимы):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:scrollbars="horizontal" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:paddingLeft="8dp" android:paddingRight="8dp">
<ListView android:id="@+id/android:list" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1"
android:drawSelectorOnTop="false" />
<TextView android:id="@+id/android:empty"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:text="No records found" />
</LinearLayout>
Тогда ваш макет строки будет вашим файлом без просмотра списка:
<?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" xmlns:myapp="http://schemas.android.com/apk/res/zaid.quotes.dlama">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/Back"
android:layout_alignParentBottom="true" android:text="Go Back"></Button>
<LinearLayout android:layout_width="wrap_content"
android:id="@+id/LinearLayout01" android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<com.admob.android.ads.AdView android:id="@+id/ad"
android:layout_width="fill_parent" android:layout_height="wrap_content"
myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC" android:layout_alignParentTop="true" />
</LinearLayout>
</RelativeLayout>
А вот пример метода getView () адаптера, в котором вы установите файл макета строки:
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.row_layout, null);
}
//Now, assuming your adapter has the list of objects to be displayed in 'records':
if(records != null) {
YourRecord r = records.get(position);
if(r != null) {
// Populate your views in your row.xml based on data from your record selected (r)
}
...
}
}