简体   繁体   English

Android如何使此EditText渐变

[英]Android How can i make a gradient of this EditText

This colour code is given to me: 此颜色代码是给我的:

background-image:-moz-linear-gradient(53% 0% -90deg,rgb(255,255,255) 0%,rgb(204,204,204) 100%); 
background-image:linear-gradient(-90deg,rgb(255,255,255) 0%,rgb(204,204,204) 100%);
width:787px;
height:142px;
border-color:rgb(221,221,221);
border-width:1px;
border-style:solid;

And ask for this this is a preview I try This code in my background of edittext 并要求这是预览,我尝试在我的edittext背景中使用此代码

 <?xml version="1.0" encoding="utf-8"?>
    <!--  res/drawable/rounded_edittext.xml -->
        <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle" android:padding="10dp">
            <solid android:color="#FFFFFF"/>

            <corners
                android:bottomRightRadius="20dp"
                android:bottomLeftRadius="20dp"
                android:topLeftRadius="20dp"
                android:topRightRadius="20dp"/>
            <gradient
                android:startColor="#ffcccccc"
                android:centerColor="#e7e7e8"
                android:type="linear"
                android:endColor="#ffcccccc"
                android:angle="90" />
      <stroke android:color="#ffdddddd"
            android:width="2dp"/>
        </shape>

Now I want same as picture but i cant get It. 现在我想和图片一样,但我听不懂。 How can i set this ? 我该如何设置?

This the right code for getting gradient. 这是获取渐变的正确代码。

     <gradient android:startColor="#ffcccccc" 
android:type="linear"
  android:centerColor="#e7e7e8"
 android:endColor="#fff5f5f6" 
android:angle="90" /> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在ContextMenu中制作EditText - How can I make an EditText in a ContextMenu 如何在 android studio 的 EditText Bold 或 Italic 中制作任何选定的文本并将其存储到 SQLite 数据库中? - How can I make any selected text in an EditText Bold or Italic in android studio and store it into a SQLite database? 我怎样才能使列表视图中的edittext数据进入数据库? - How can i make data from an edittext in a listview go into the database? 如何确保我的 EditText 始终具有焦点? - How can I make sure my EditText always has focus? 如果输入正确,我怎样才能让(EditText)自动将用户发送到另一个页面? 无需按钮。 android 工作室 - How can I make the (EditText) automatically send the user to the other page if the input is correct? without need button. android Studio 我想在Android中为6个edittext框制作函数,其中包括edittext的所有属性,以便我可以简单地调用function - i want to make function for 6 edittext boxes in android which includes all properties of edittext so that i can just simply call function Android Studio 如何使用字符串字符数创建edittext? - Android Studio How can I create edittext with number of string characters? 如何将Android EditText组件的值作为整数获取? - How can I get the value of an Android EditText component as an integer? 我怎么知道 cursor 在 Android 中的edittext - How can I know the cursor in which edittext in Android edittext visible意味着我如何检查android中的if条件 - edittext visible means how can i check the if condition in android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM