我有一個包含文本視圖,按鈕,微調和列表視圖一個活動
我的主XML文件包含:
如何更改FONTCOLOR和我的ListView的字體類型
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffff00"
tools:context="com.example.taxitabriz.MainActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:text="@string/app_name"
android:textSize="35dp"
android:textStyle="bold"
android:textColor="#996600"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="@+id/linearlayout1" >
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#996600"
android:text="@string/exit"
android:background="@drawable/backbutton" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#996600"
android:text="@string/about"
android:background="@drawable/backbutton" />
</LinearLayout>
<Spinner
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/textView1"
android:layout_marginTop="19dp" />
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/spinner1"
android:layout_above="@+id/linearlayout1"
android:layout_alignParentRight="true"
android:layout_weight="49.94" >
</ListView>
和我的java代碼部分是在這裏:
ArrayAdapter<String> ard=new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line,s1);
sp.setAdapter(ard);
lv1=(ListView) findViewById(R.id.listView1);
ArrayAdapter<String> ard1=new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line,s1);
lv1.setAdapter(ard1);
,但我不能改變FON t列表視圖或微調器中的顏色或字體類型。我該怎麼做?
感謝您的回答。在這種方法中,我如何使用OnClickListener方法來管理選定的項目? –