我是android新手.我想画这个图像(匹配统计)
并用10%到100%的颜色填充图像.我试了这么多,这是图像
这是代码
public class DrawView extends View {
Paint paint = new Paint();
public DrawView(Context context) {
super(context);
}
@Override
public void onDraw(Canvas canvas) {
paint.setColor(Color.BLACK);
paint.setStrokeWidth(3);
canvas.drawRect(30, 30, 100, 100, paint);
paint.setStrokeWidth(0);
paint.setColor(Color.GRAY);
canvas.drawRect(33, 60, 97, 97, paint);
paint.setColor(Color.WHITE);
canvas.drawRect(33, 33, 97, 60, paint);
}
Run Code Online (Sandbox Code Playgroud)
任何建议对我都有帮助.提前致谢.
我是Android新手.我目前正在使用Android应用程序,当我尝试运行应用程序时,会发生此错误.
我已经研究但无法解决这个错误.
的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
multiDexEnabled true
applicationId "com.tutorialsbuzz.androidfacebook"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
}
Run Code Online (Sandbox Code Playgroud)
先感谢您
该函数用于查找最大数量。我还需要比较数字,如果输入是相同的数字,则显示数字是相同的。正如我所取的a=2,b=8, ,c=8三个数字的最大值8,程序也应该显示 和b是c相同的。
def biggest(a,b,c):
if a>b and a>c :
print("Biggest Number=",a)
elif b>a and b>c:
print("Biggest Number=",b)
elif a==b:
print("a=b")
elif a==c:
print("a=c")
elif b==c:
print("b=c")
else:
print("Biggest Number=",c)
biggest(2,8,8)
Run Code Online (Sandbox Code Playgroud)