假设我有一个扩展ViewGroup的类
public class MapView extends ViewGroup
它包含在布局map_controls.xml
中,如下所示
<com.xxx.map.MapView
android:id="@+id/map"
android:background="@drawable/address"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</com.xxx.map.MapView>
如何从AttributeSet中检索构造函数中的属性?让我们假设背景区域中的可绘制的。
public MapView(Context context, AttributeSet attrs) {
}
https://stackoverflow.com/questions/8037101
复制相似问题