StateListDrawable을 추가 한 LinearLayout 위에 TextViews와 ImageView를 표시하려고합니다. 나는이 같은 내 버튼을 만들 :StateListDrawable 위에 TextView
는protected StateListDrawable generateButton(String[] colors, String[] selectColors, String strokeColor, int strokewidth)
{
int[] iColors = CurrentTheme.getIntColorArrayFromStringArray(colors);
GradientDrawable gd = new GradientDrawable(Orientation.TL_BR, iColors);
gd.setCornerRadius(10);
gd.setStroke(strokewidth, Color.parseColor(strokeColor));
int[] iSelectColors = CurrentTheme.getIntColorArrayFromStringArray(selectColors);
GradientDrawable sgd = new GradientDrawable(Orientation.TL_BR, iSelectColors);
sgd.setCornerRadius(10);
sgd.setStroke(strokewidth, Color.parseColor(strokeColor));
StateListDrawable slDrawable = new StateListDrawable();
slDrawable.addState(new int[] { android.R.attr.state_pressed }, sgd);
slDrawable.addState(StateSet.WILD_CARD, gd);
return slDrawable;
}
내 활동에서 나는 그래서 같이있는 LinearLayout이 당김을 추가
레이아웃이 내 활동의 내용을보기에서 다음 줄에 포함되어_topMenuButton.setBackgroundDrawable(_theme.getPrimaryButtonDrawable());
:
<include layout="@layout/inc_button_menu" android:id="@+id/second_menu_button" />
ImageView와 두 개의 TextView가있는 LinearLayout을 포함합니다.
LinearLayout (내 Activity에서 StateListDrawable을 추가 한)에서 TextViews를 가져 와서 텍스트를 추가하려고하면 텍스트가 표시되지 않습니다. ImageView도 마찬가지입니다. 이 뷰를 어떻게 표시 할 수 있는지 잘 모르겠습니다.
도움을 주시면 대단히 감사하겠습니다.