이름이 '루네드버튼.1믈 드로어 블 폴더에서는' 에서 xml 파일을 만듭니다
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#eeffffff" />
<corners android:bottomRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:topRightRadius="8dp"
android:topLeftRadius="8dp"/>
</shape>
결국 세트를 배경으로 '안드로이드', ',' 으로 배경 = " @drawable/roundedbutton" 데이터베이스에구성원을 버튼를.
이를 해결하기 위해 완전히 스케쳐내 라운드된 변경하십시오 반지름 및 생각하신거야 정상 당신꺼에요.
xml 버전을 = " < 1.0";;? 인코딩입니다 = " utf-8" >;;? 안드로이드 >;;; (http://schemas.android.com/apk/res/android") = " < 선택기를 xmlns 를: < 항목설명프로세서 android:state_pressed = " false" >;;; 안드로이드, 모양,, = " rectangle" > < 모양. 코너를 <, 안드로이드, 1000dp" " 반지름입니다 =. />. , # 41ba7a" color = " < 솔리드로 안드로이드. />. 선 <. width = ", 2dip", 안드로이드. color = ", # 03ae3c", 안드로이드. />. 패딩 <. 아래 = ", 4dp", 안드로이드. 왼쪽 = ", 4dp", 안드로이드. 오른쪽 = ", 4dp", 안드로이드. 안드로이드: 상단형 = " 4dp"; />. < /shape>; < /item>; < 항목설명프로세서 android:state_pressed = " true" >;;; 안드로이드, 모양,, = " rectangle" > < 모양. 코너를 <, 안드로이드, 1000dp" " 반지름입니다 =. />. , # 3AA76D" color = " < 솔리드로 안드로이드. />. 선 <. width = ", 2dip", 안드로이드. color = ", # 03ae3c", 안드로이드. />. 패딩 <. 아래 = ", 4dp", 안드로이드. 왼쪽 = ", 4dp", 안드로이드. 오른쪽 = ", 4dp", 안드로이드. 안드로이드: 상단형 = " 4dp"; />. < /shape>; < /item>; < /selector>;
버튼를 <. android:layout_width = " 220dp"; android:layout_height = " 220dp"; 안드로이드: 배경 = " @drawable/button_states"; 안드로이드: 텍스트 = " @string/btn_scan_qr"; id = ", @+id/btn_scan_qr", 안드로이드. 안드로이드 티스트시즈 = " 15dp"; />.
(이 라이브러리는 더 이상 사용되지 않으며 어떠한 새로운 뜬다급격한 개발. 대신 팹 (fab) 을 사용하는 것이 좋습니다.)
xml 버전을 = " < 1.0";;? 인코딩입니다 = " utf-8" >;;?
<, 모양, http://schemas.android.com/apk/res/android", 안드로이드 = " xmlns 를: 안드로이드: 모양 = " rectangle" >;;
<corners android:bottomRightRadius="180dip"
android:bottomLeftRadius="180dip"
android:topRightRadius="180dip"
android:topLeftRadius="180dip"/>
<solid android:color="#6E6E6E"/> <!-- this one is ths color of the Rounded Button -->
< /shape>;
이 단추를 코드 추가
android:layout_width="50dp"
android:layout_height="50dp"
형태를 띠는 데 있다. 따라서 버튼를 오벌
xml 버전을 = " < 1.0";;? 인코딩입니다 = " UTF-8" >;;? xmlns 를 < 레이어에는 목록 ", http://schemas.android.com/apk/res/android", 안드로이드 =, >.
<item>
<shape android:shape="oval" >
<stroke
android:height="1.0dip"
android:width="1.0dip"
android:color="#ffee82ee" />
<solid android:color="#ffee82ee" />
<corners
android:bottomLeftRadius="12.0dip"
android:bottomRightRadius="12.0dip"
android:radius="12.0dip"
android:topLeftRadius="12.0dip"
android:topRightRadius="12.0dip" />
</shape>
</item>
< /layer-list>;
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="#ffffff"
/>
</shape>
Xml 에 있는 설정되었습니다 드로어 블 자원 및 간단한 사용 및 이미지 단추를 사용하여 드로어 블 라운드하지 있는 이미지를 배경으로.
https://stackoverflow.com/questions/3914329/round-button-in-android
'와' 앵거버튼 사용순환 배경 이미지를 만들 수 있습니다.
둥근 모양을 만들기 위해 버튼를.
<?xml version="1.0" encoding="utf-8"?>
<, 모양, http://schemas.android.com/apk/res/android", 안드로이드 = " xmlns 를: 안드로이드: 모양 = " oval"; >.
<stroke
android:width="8dp"
android:color="#FFFFFF" />
<solid android:color="#ffee82ee" />
<corners
android:bottomLeftRadius="45dp"
android:bottomRightRadius="45dp"
android:topLeftRadius="45dp"
android:topRightRadius="45dp" />
< /shape>;
이를 통해 단추를 사용하여 배경 링크
http://radleymarx.com/blog/simple-guide-to-9-patch/
http://ogrelab.ikratko.com/custom-color-buttons-for-android/
Google& # 39 의 플로팅스션버튼 사용할 수 있습니다.
XMl:
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_dialog_email" />
Java:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FloatingActionButton bold = (FloatingActionButton) findViewById(R.id.fab);
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Do Stuff
}
});
}
Gradle:
compile 'com.android.support:design:23.4.0'
이는
android.R.drawable.expander_ic_minimized
안드로이드 구축됨 들여다 볼 수 있는 드로어 블:
". https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html # 포레그로운스타이프 = = = =;;; 포크라운d.스파시오스트림 image& 0& 포크라운d.스파시오파드 0.25& 포레쿠로 rgba (94%2C% 20126%2C% 20142%2C% 200), 박콜러 & rgb (96%2C% 20125%2C% 20139) = = = = =;; 효과, 이름, 오려내기로 & 1& backgroundShape circle& none& ic_home ".
및 다운로드 폴더 안에 있는 it, it, 에스트라스트 밉맵 하드피 찾습니다.
복사합니다를 이미지와 밉맵 하드피 폴더 및 붙이십시오 드와이블 있는 폴더로 안드로이드 프로젝트.
이제 배경 설정 같은 이미지.