是否有可能继承" declare-styleable属性到其他(子)视图中?
可以在gauge:visibility
android:visibility
activity_main.xml中:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:gauge="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.MainActivity">
<com.example.gauges.GradientCircleGauge
android:id="@+id/gcg_gauge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
gauge:visibility="visible"
</com.example.gauges.GradientCircleGauge>
</RelativeLayout>
gradient_circle_gauge.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:indeterminate="false"
android:max="100"
android:visibility="????"
android:progress="100"
android:progressDrawable="@drawable/circle_gauge_background" />
</RelativeLayout>