2014-10-27 19 views
0

這就是我想要達到的目標:TypedArray的Android無法獲得應有的價值

xml文件

app:loaderStyle="?android:attr/progressBarStyleLarge" 

代碼

int loaderStyle = loaderProperties.getResourceId(R.styleable.LoaderButton_loaderStyle, 
      android.R.attr.progressBarStyleSmall); 
... 
mLoader = new ProgressBar(getContext(), null, loaderStyle); 

loaderStyle != android.R.attr.progressBarStyleLarge 

待辦事項你知道爲什麼?

回答

0

它的作品,但我必須消費的風格屬性。也許對某個人來說它會很有用。更先進的答案,歡迎

xml文件

style="?android:attr/progressBarStyleLarge" 

代碼

mLoader = new ProgressBar(getContext(), null, mAttributeSet.getStyleAttribute());