내 Register 클래스에서 원형 이미지보기를 만들려고합니다. 나는 많은 솔루션을 시도했지만 솔루션 중 어느 것도 나를 위해 일하지 않았습니다. 누군가가 문제를 이해하도록 도와 줄 수 있습니까? 감사.순환 이미지보기를 만드는 방법
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.seng.healthyapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-location:9.2.0'
}
register.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/imgProfilePicture"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginBottom="20dp"
app:civ_border_width="3dp"
app:civ_border_color="@color/white"
android:background="@mipmap/profile" />
<EditText
android:id="@+id/editTextName"
android:layout_width="325dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@color/white"
android:hint="@string/hint_name"
android:padding="10dp"
android:singleLine="true" />
<EditText
android:id="@+id/editTextPassword"
android:layout_width="325dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@color/white"
android:hint="@string/hint_password"
android:inputType="textPassword"
android:padding="10dp"
android:singleLine="true" />
<!-- Login Button -->
<EditText
android:id="@+id/editTextConfirmPassword"
android:layout_width="325dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@color/white"
android:hint="@string/confirm_password"
android:inputType="textPassword"
android:padding="10dp"/>
<Button
android:id="@+id/buttonSave"
android:layout_width="325dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@color/blue"
android:text="Confirm"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="15dp" />
</LinearLayout>
내가 변수 비트 맵에 대한 놓아야 값이 무엇인지 알 수 있습니까? – Tony
나는 내 awnser를 편집했다. Drawable에서 BitmapFactory.decodeResource를 사용할 수 있다면 몇 가지 방법으로 Bitmap을 만들 수있다. –
고마워, 저에게 효과적이다. – Tony