
<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:tools="http://schemas.androID.com/tools"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"androID:background="#FFFFFF"tools:context="com.example.androIDmaterialsamples.MainActivity" ><ImageVIEw androID:ID="@+ID/sampleImage" androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content" androID:src="@drawable/ic_launcher" androID:layout_centerInParent="true" androID:elevation="10dp"/> </relativeLayout>
它没有显示该图像的任何阴影.我做错了吗?需要一些帮助.谢谢.
我也尝试过这种方式,但输出仍然没有变化.
<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:shape="rectangle"><solID androID:color="#0073ff" /><corners androID:radius="16dp" /></shape><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:tools="http://schemas.androID.com/tools"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"androID:background="#FFFFFF"tools:context="com.example.androIDmaterialsamples.MainActivity" ><TextVIEw androID:ID="@+ID/sampleImage" androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content" androID:text="my name is nilesh" androID:padding="10dp" androID:textSize="20sp" androID:layout_centerInParent="true" androID:elevation="12dp" androID:background="@drawable/background"/></relativeLayout>解决方法 而不是使用androID:src你需要更改为androID:background来显示阴影.
<ImageVIEw androID:ID="@+ID/image" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:elevation="10dp" androID:background="@drawable/ic_launcher"/>总结
以上是内存溢出为你收集整理的Elevation属性不工作android全部内容,希望文章能够帮你解决Elevation属性不工作android所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)