내 listview에 문제가 있습니다. 기본적으로 (listview에서) 필드의 텍스트를 기본적으로 흰색이 아닌 검정색으로 변경합니다. 나는 이것을 관리하는 방법에 대한 간단한 지침을 따라 왔지만 그것이 나를 위해 일하지 않는다. 이 안내서는 http://www.hascode.com/2011/12/writing-styles-and-themes-on-android/입니다.Listviews 텍스트 글꼴
이것은 내 style.xml 파일 I 텍스트에 어두운 색 입력하려고했다 : 이것은 내 할 bookmarks.xml입니다
<style name="CustomTextView" parent="@android:style/Widget.TextView">
<item name="android:typeface">monospace</item>
<item name="android:textColor">#000000</item>
</style>
을 내가 다음 코드로 목록보기에서 스타일을로드하려고했다 :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/CustomTextView">
</ListView>
</LinearLayout>
대신 style.xml의 상위 이름을 TextAppearance.Medium으로 변경하려고했지만 아무 것도 작동하지 않습니다. 나는 그저 색을 바꾸지 않을 수없는 이유는 무엇인가? 도와주세요! 고맙습니다!
무슨 뜻인지 이해합니다. 문제는 가이드를 따라 가면 텍스트 요소를 설정할 수있는 UI 요소 (텍스트 뷰)를 만들지 못했습니까? 그래서 나는 그가 어떻게 바꿀 수 있는지 이해하지 못한다. listview를 배치했는데 bookmarks.xml 파일에 새 TextView를 만들까요? 내가 말하고자하는 것은, 내가 직접 구현하지 않았기 때문에 listview에 대한 현재 UI 요소 (textview)가 배치되어 있다는 것을 모른다는 것이다. – user1293618
res/layout에 새로운 xml 파일에 textview가 포함되어있다. 이 텍스트 뷰에 id를 할당하고 어댑터에 전달하십시오. – Blackbelt
그것은 작동 했는가 ...? – Blackbelt