GradientDrawable.SetStroke 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| SetStroke(Int32, ColorStateList) |
设置可绘制的笔划宽度和颜色状态列表。 |
| SetStroke(Int32, Color) |
设置可绘制的笔划宽度和颜色。 |
| SetStroke(Int32, ColorStateList, Single, Single) |
设置可绘制的笔划宽度和颜色状态列表。 |
| SetStroke(Int32, Color, Single, Single) |
设置可绘制的笔划宽度和颜色。 |
SetStroke(Int32, ColorStateList)
设置可绘制的笔划宽度和颜色状态列表。
[Android.Runtime.Register("setStroke", "(ILandroid/content/res/ColorStateList;)V", "GetSetStroke_ILandroid_content_res_ColorStateList_Handler")]
public virtual void SetStroke(int width, Android.Content.Res.ColorStateList? colorStateList);
[<Android.Runtime.Register("setStroke", "(ILandroid/content/res/ColorStateList;)V", "GetSetStroke_ILandroid_content_res_ColorStateList_Handler")>]
abstract member SetStroke : int * Android.Content.Res.ColorStateList -> unit
override this.SetStroke : int * Android.Content.Res.ColorStateList -> unit
参数
- width
- Int32
笔划的宽度(以像素为单位)
- colorStateList
- ColorStateList
笔划的颜色状态列表
- 特性
注解
设置可绘制的笔划宽度和颜色状态列表。 如果宽度为零,则不绘制笔划。
注意:更改此属性将影响从资源加载的可绘制的所有实例。 建议在更改此属性之前调用 #mutate() 。
Java文档android.graphics.drawable.GradientDrawable.setStroke(int, android.content.res.ColorStateList)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
另请参阅
- <xref:Android.Graphics.Drawables.GradientDrawable.SetStroke(System.Int32%2c+Android.Content.Res.ColorStateList%2c+Android.Content.Res.ColorStateList%2c+Android.Content.Res.ColorStateList)>
适用于
SetStroke(Int32, Color)
设置可绘制的笔划宽度和颜色。
[Android.Runtime.Register("setStroke", "(II)V", "GetSetStroke_IIHandler")]
public virtual void SetStroke(int width, Android.Graphics.Color color);
[<Android.Runtime.Register("setStroke", "(II)V", "GetSetStroke_IIHandler")>]
abstract member SetStroke : int * Android.Graphics.Color -> unit
override this.SetStroke : int * Android.Graphics.Color -> unit
参数
- width
- Int32
笔划的宽度(以像素为单位)
- color
- Color
笔划的颜色
- 特性
注解
设置可绘制的笔划宽度和颜色。 如果宽度为零,则不绘制笔划。
注意:更改此属性将影响从资源加载的可绘制的所有实例。 建议在更改此属性之前调用 #mutate() 。
Java文档android.graphics.drawable.GradientDrawable.setStroke(int, int)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
另请参阅
- <xref:Android.Graphics.Drawables.GradientDrawable.SetStroke(System.Int32%2c+Android.Graphics.Color%2c+Android.Graphics.Color%2c+Android.Graphics.Color)>
适用于
SetStroke(Int32, ColorStateList, Single, Single)
设置可绘制的笔划宽度和颜色状态列表。
[Android.Runtime.Register("setStroke", "(ILandroid/content/res/ColorStateList;FF)V", "GetSetStroke_ILandroid_content_res_ColorStateList_FFHandler")]
public virtual void SetStroke(int width, Android.Content.Res.ColorStateList? colorStateList, float dashWidth, float dashGap);
[<Android.Runtime.Register("setStroke", "(ILandroid/content/res/ColorStateList;FF)V", "GetSetStroke_ILandroid_content_res_ColorStateList_FFHandler")>]
abstract member SetStroke : int * Android.Content.Res.ColorStateList * single * single -> unit
override this.SetStroke : int * Android.Content.Res.ColorStateList * single * single -> unit
参数
- width
- Int32
笔划的宽度(以像素为单位)
- colorStateList
- ColorStateList
笔划的颜色状态列表
- dashWidth
- Single
短划线的长度(以像素为单位),设置为 0 以禁用短划线
- dashGap
- Single
短划线之间的间距(以像素为单位)
- 特性
注解
设置可绘制的笔划宽度和颜色状态列表。 如果宽度为零,则不绘制笔划。 此方法还可用于短划笔划。
注意:更改此属性将影响从资源加载的可绘制的所有实例。 建议在更改此属性之前调用 #mutate() 。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
另请参阅
- <xref:Android.Graphics.Drawables.GradientDrawable.SetStroke(System.Int32%2c+Android.Content.Res.ColorStateList)>
适用于
SetStroke(Int32, Color, Single, Single)
设置可绘制的笔划宽度和颜色。
[Android.Runtime.Register("setStroke", "(IIFF)V", "GetSetStroke_IIFFHandler")]
public virtual void SetStroke(int width, Android.Graphics.Color color, float dashWidth, float dashGap);
[<Android.Runtime.Register("setStroke", "(IIFF)V", "GetSetStroke_IIFFHandler")>]
abstract member SetStroke : int * Android.Graphics.Color * single * single -> unit
override this.SetStroke : int * Android.Graphics.Color * single * single -> unit
参数
- width
- Int32
笔划的宽度(以像素为单位)
- color
- Color
笔划的颜色
- dashWidth
- Single
短划线的长度(以像素为单位),设置为 0 以禁用短划线
- dashGap
- Single
短划线之间的间距(以像素为单位)
- 特性
注解
设置可绘制的笔划宽度和颜色。 如果宽度为零,则不绘制笔划。 此方法还可用于短划笔划。
注意:更改此属性将影响从资源加载的可绘制的所有实例。 建议在更改此属性之前调用 #mutate() 。
Java文档android.graphics.drawable.GradientDrawable.setStroke(int, int, float, float)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
另请参阅
- <xref:Android.Graphics.Drawables.GradientDrawable.SetStroke(System.Int32%2c+Android.Graphics.Color)>