2014-02-22 3 views
1

내 Android 프로젝트에서 런타임 중에 동적으로 app:footerColor="#1573D6"의 xml 속성 색상을 변경해야합니다. 이것을 어떻게 할 수 있습니까?런타임 중에 XML 또는 레이아웃 변경

앱 실행 중에도 레이아웃을 변경할 수는 있지만 어떻게 할 수 있는지 찾아 보았습니다. 아무 것도 찾을 수 없었습니다.

일부 도움이 될 것입니다. 고맙습니다.

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <com.viewpagerindicator.TitlePageIndicator 
     android:id="@+id/tabloid" 

     android:padding="10dip" 
     android:layout_height="40dp" 
     android:layout_width="fill_parent" 

     android:background="#000000"  
     android:textColor="#1573D6" 
     app:footerColor="#1573D6" 

     app:footerLineHeight="2dp" 
     app:footerIndicatorStyle="none" 

     app:selectedColor="#FFFFFF" 
     app:selectedBold="true" /> 


    <android.support.v4.view.ViewPager 
     android:id="@+id/pager" 

     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" /> 
+0

왜이 질문을 다시 게시 하시겠습니까? – Muel

+0

게시 : ** 완전한 ** XML 및 일부 코드, 변경이 발생해야합니다. –

+0

이제 모든 XML 코드 – user3050910

답변

2

당신이 코드에서이 작업을 수행 할 수 있습니다 :

TitlePageIndicator 표시 = (TitlePageIndicator) findViewById를 (R.id.yourview를)

indicator.SetFooterColor (컬러

여기 내 XML입니다. 구문 분석 (# 1573D6))

+0

이것은 그 것이다! 대단히 감사합니다. 이제 더 배웠습니다. 공유해 주셔서 감사합니다 !! – user3050910

관련 문제