여기서 그라디언트는 그래디언트 배경 및 there& 만들려는 s # 39 위, 아래 있는 등 단색 반단면 반단면, 이 그림에서는:
! 그라디언트의 버튼의 점점 파란색, 흰색 수평선 위에, 바닥 위에 있다.
내가 만들 수 있는 방법은 먼저 같은 배경 이미지? 내가 만들 수 있는 방법은 '작은' s not 전파하므로 아웃해야 센테르코로 that& # 39,?
이는 XML 코드를 배경 단추을.
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:startColor="#6586F0"
android:centerColor="#D6D6D6"
android:endColor="#4B6CD6"
android:angle="90"/>
<corners
android:radius="0dp"/>
</shape>
종료기 대체하십시오:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:angle="90"
android:centerColor="#555994"
android:endColor="#b5b6d2"
android:startColor="#555994"
android:type="linear" />
<corners
android:radius="0dp"/>
</shape>
이 같은 질문이예요 인텔®visual 참조용이므로 도움말에서는
Xml 파일을 만들기 위해 res / 드로어 블 그래디언트 만들 수 있습니다. 나는 내거냐 호출하십시오 my_gradient_drawable.xml :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:type="linear"
android:angle="0"
android:startColor="#f6ee19"
android:endColor="#115ede" />
</shape>
일부 it 설정한 배경에 보기입니다. 예를 들면 다음과 같습니다.
<View
android:layout_width="200dp"
android:layout_height="100dp"
android:background="@drawable/my_gradient_drawable"/>
'각도' 설정 '대한' 일괄이라는 유형:. 45 도 배수이어야 합니다.
<gradient
android:type="linear"
android:angle="0"
android:startColor="#f6ee19"
android:endColor="#115ede" />
'설정' 대한 '그래디엔트라디우스 요골동맥' 유형:. 이는 가장 작은 치수처리 백분율입니다. '는' %p 사용하여 부모.
<gradient
android:type="radial"
android:gradientRadius="10%p"
android:startColor="#f6ee19"
android:endColor="#115ede" />
<gradient
android:type="sweep"
android:startColor="#f6ee19"
android:endColor="#115ede" />
The center of the 재동기화를 요골동맥 유형 또는 변경할 수도 있습니다. 이 값은 폭과 높이를 분수가 있다. '%P' 표기법을 사용할 수도 있습니다.
android:centerX="0.2"
android:centerY="0.7"
이 슬라이드에서는 이전 오토메이티드 자세한 자습서는 합니다. 멀티 그래디언트 날까로움.
[1]: http://developer.android.com/guide/topics/resources/drawable-resource.html # 라이어리스트
링크를 만들 수 있다 (http://angrytools.com/gradient/) 에서 안드로이드 사용자 정의 그래디언트 스티스 photoshop 에서 같은 데 도움이 될 수 있습니다.
먼저 다음과 같이 그래디엔t.1믈 만들어야 합니다.
<shape>
<gradient android:angle="270" android:endColor="#181818" android:startColor="#616161" />
<stroke android:width="1dp" android:color="#343434" />
</shape>
그런 배경에서 그래디언트 그들위에 말할 필요가 있다. 다음과 같이
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/gradient"
>
</LinearLayout>
에서 사용할 수 있는 것을 생각할 수 있는 코드 또는 PSD:
private void FillCustomGradient(View v) {
final View view = v;
Drawable[] layers = new Drawable[1];
ShapeDrawable.ShaderFactory sf = new ShapeDrawable.ShaderFactory() {
@Override
public Shader resize(int width, int height) {
LinearGradient lg = new LinearGradient(
0,
0,
0,
view.getHeight(),
new int[] {
getResources().getColor(R.color.color1), // please input your color from resource for color-4
getResources().getColor(R.color.color2),
getResources().getColor(R.color.color3),
getResources().getColor(R.color.color4)},
new float[] { 0, 0.49f, 0.50f, 1 },
Shader.TileMode.CLAMP);
return lg;
}
};
PaintDrawable p = new PaintDrawable();
p.setShape(new RectShape());
p.setShaderFactory(sf);
p.setCornerRadii(new float[] { 5, 5, 5, 5, 0, 0, 0, 0 });
layers[0] = (Drawable) p;
LayerDrawable composite = new LayerDrawable(layers);
view.setBackgroundDrawable(composite);
}
//Color.parseColor() method allow us to convert
// a hexadecimal color string to an integer value (int color)
int[] colors = {Color.parseColor("#008000"),Color.parseColor("#ADFF2F")};
//create a new gradient color
GradientDrawable gd = new GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM, colors);
gd.setCornerRadius(0f);
//apply the button background to newly created drawable gradient
btn.setBackground(gd);
여기에서) 는 다음과 같은 뜻이 있다 https://android-code.blogspot.in/2015/01/android-button-gradient-color.html
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#3f5063"
/>
<corners android:bottomRightRadius="0dp" android:bottomLeftRadius="30dp" android:topLeftRadius="30dp" android:topRightRadius="0dp" />
<padding android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp" />
<gradient
android:startColor="#2ea4e7"
android:centerColor="#015664"
android:endColor="#636969"
android:angle="45"
>
</gradient>
<stroke android:color="#000000"
android:width="1dp">
</stroke>
< /shape>;
왜안돼요 생성하시겠습니까 이미지 또는 9 패치합니다 이미지와 사용하는?
어떻게 해야 좋은 아래 링크를 안내선 에 있다.
[http://android.amberfog.com/? p = 247] [1]
사용하는 경우, 아래 사이트 시도하시겠습니까 준수하십시오 모양 (일부 안드로이드 dell. 왼쪽 아래). http://angrytools.com/gradient/
[http://angrytools.com/gradient/? 0_6586f0.54_4B6CD6.2_D6D6D6&, 0_100,100_100&, l_269] [3]
[1]: http://android.amberfog.com/? p = 247
[3]: http://angrytools.com/gradient/? 0_6586f0.54_4B6CD6.2_D6D6D6& l_269 0_100,100_100&;