我想知道如何在android中的文本上添加阴影?
我有以下代码应用于位图,我想被阴影...
paint.setColor(Color.BLACK);
paint.setTextSize(55);
paint.setFakeBoldText(false);
paint.setShadowLayer(1, 0, 0, Color.BLACK); //This only shadows my whole view...
Run Code Online (Sandbox Code Playgroud) 我正在尝试在单击按钮时播放声音文件,但不断出现错误.
错误是:
"The method create(Context, int) in the type MediaPlayer is not applicable for the arguments (new View.OnClickListener(){}, int)"
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Button zero = (Button)this.findViewById(R.id.btnZero);
zero.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mp = MediaPlayer.create(this, R.raw.mamacita_zero);
}
});
}
Run Code Online (Sandbox Code Playgroud)
任何帮助或提示将不胜感激.日Thnx!
我在iOS中遇到了一个设计问题.
我有一个带背景图像的控制器,没什么特别的.
this.View.BackgroundColor = UIColor.FromPatternImage (UIImage.FromFile ("Images/ballons.jpg"));
Run Code Online (Sandbox Code Playgroud)
在控制器的顶部,我有一个半透明的背景颜色(白色)视图.
this.Frame = new System.Drawing.RectangleF (0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
this.BackgroundColor = UIColor.White;
this.Alpha = 0.5f;
Run Code Online (Sandbox Code Playgroud)
现在的问题是,如果我在视图中添加一个按钮或任何其他控件,它们也会变得透明......所以我在这里想错了...?
我希望控制器有一个背景图像,视图是白色半透明背景,所有控件(按钮,图像)根本不透明......