마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

textview 글자색 변경 질문

0 추천

 

xml파일
<LinearLayout android:id="@+id/create_layout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:orientation="vertical">
    
    <LinearLayout 
        android:orientation="horizontal"
        android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:layout_gravity="center"
    android:layout_weight="1" >
 
        <TextView
            android:id="@+id/title_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ems="5"
            android:gravity="center"
            android:hint="@string/roomtitle" />
        
        <EditText
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine = "true"
            android:ems="10" />
        
    </LinearLayout>
 
소스코드
 
TextView titleView = (TextView)findViewById(R.id.title_label);
titleView.setTextSize(20);
titleView.setTextColor(Color.RED);
 
이렇게 했는데
 
글자색이 안바뀌고 회색으로 나옵니다
xml에서 속성으로 바꿔도 안변해요ㅠㅠ

 

익명사용자 님이 2013년 3월 11일 질문
혹시 힌트의 색을 말씀하시는 것이 아닌가 생각되네요...
android:text="@string/roomtitle" 로 했을때의 색을 확인해보세요.
TextView에서 hint를 쓰신 이유는 잘 모르겠네요..
아!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
정말 감사합니다!!!!!!!!!!!!!!
아 진짜 저 바봇인가봐요ㅠㅠㅠㅠㅠㅠㅠㅠ
아 왜 저걸 전 텍스트로 생각하고있었을까요.......
힌트니 당연히 색갈이 안변하지ㅠㅠㅠㅠㅠㅠㅠ
정말 감사합니다!!!!!

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...