Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Android径向渐变大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有跟随drawable set作为LinearLayout背景: @H_674_2@<?xml version="1.0" encoding="utf-8"?> <@L_489_1@ xmlns:android="http://scheR_684_11845@as.android.com/apk/res/android"> <item> <bitmap android:tileMode="repeat" android:dither="true" android:src="@drawable/bg"/> </item> <item> <shape android:shape="rectangle"> <gradient android:startColor="#ffff0000" android:endColor="#ff00ff00" android:centerX="50%" android:centerY="50%" android:gradienTradius="50%" android:type="radial"/> </shape> </item> </@L_489_1@>

根据docs,gradienTradius可以设置为窗口/父级大小的百分比.不幸的是……它没有用.半径是0.我做错了什么?或Android有什么问题?

我需要径向渐变来填充整个屏幕.解决方法是什么?

解决方法

如果我很清楚你需要什么,你必须制作由drawable引用的布局

(“match_parent”),

如下 :

@H_674_2@<LinearLayout xmlns:android="http://scheR_684_11845@as.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:BACkground="@drawable/"your drawable xml name">

希望这个帮助.

大佬总结

以上是大佬教程为你收集整理的Android径向渐变全部内容,希望文章能够帮你解决Android径向渐变所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。