<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff" />
<stroke android:width="1dp"
android:color="#000000" />
</shape>
Run Code Online (Sandbox Code Playgroud)
我正在使用此代码setBackgroundResource(R.drawable.selfbg);
当我使用此代码时,光标在Edittext中不可见.
用户可以更改在编辑屏幕中显示为默认值的裁剪框大小.我尝试使用以下代码:
- (UIImage *)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect {
CGImageRef imageRef = CGImageCreateWithImageInRect([imageToCrop CGImage], rect);
UIImage *cropped = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
return cropped;
}
Run Code Online (Sandbox Code Playgroud)
但它裁剪固定区域.如何裁剪用户选择的区域?