2017-08-21 11 views
0

Cuboid circleボタンはアンドロイドのカスタムサークルボタンです(ソース:Github Cuboid Circle Button)。実行時にCuboid circleボタンの色を変更してください

私のアプリでそのボタンを使用しています。それはうまく動作しますが、実行時にプログラムで色を変更する方法が見つかりません。クラスで

onCreate前に私が持っている:

その後

com.cuboid.cuboidcirclebutton.CuboidButton btnReplayEnd;

onCreateに:

btnReplayEnd = (com.cuboid.cuboidcirclebutton.CuboidButton) findViewById(R.id.btnReplayEnd);

そして 'setTheme' メソッドで(同じクラスに):

btnReplayEnd.setCircle_color(getResources().getColor(R.color‌.replayNormalDark));

答えて

0

使用して、あなただけのxmlを経由して、それを変更することができ、プログラムでcom.cuboid.cuboidcirclebutton.CuboidButtonのcircler色を変更する方法はありません。この

<com.cuboid.cuboidcirclebutton.CuboidButton 
      android:layout_width="120dp" 
      android:layout_height="120dp" 
      android:layout_centerInParent="true" 
      android:text="No Border" 
      android:textColor="#000000" 
      android:textSize="18sp" 
      app:cub_border_radius="0dp" 
      app:cub_color="@color/color_03A9F4" 
      app:cub_fontstyle="fonts/Bellerose.ttf" 
      app:cub_hover_color="#00BFFF1" 
      /> 
よう
app:cub_color="@color/color_03A9F4"
関連する問題