的风格这些都是我的微调和编辑文本的样子: android-如何改变我的编辑文字和微调
这些都是我看见别的地方微调和编辑文本和我喜欢他们:
如何更改我的edittext和spinners以查看第二个图像?
我使用的应用程序紧凑反正
感谢微调风格
的风格这些都是我的微调和编辑文本的样子: android-如何改变我的编辑文字和微调
这些都是我看见别的地方微调和编辑文本和我喜欢他们:
如何更改我的edittext和spinners以查看第二个图像?
我使用的应用程序紧凑反正
感谢微调风格
解决方案: 创建为您的微调自定义布局的自定义适配器。
Spinner spinner = (Spinner) findViewById(R.id.pioedittxt5);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.travelreasons, R.layout.simple_spinner_item);
adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
R.layout.simple_spinner_item
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="@style/spinnerItemStyle"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee" />
R.layout.simple_spinner_dropdown_item
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="@style/spinnerDropDownItemStyle"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="?android:attr/dropdownListPreferredItemHeight"
android:ellipsize="marquee" />
In styles add your custom dimensions and height as per your requirement.
<style name="spinnerItemStyle" parent="android:Widget.TextView.SpinnerItem">
</style>
<style name="spinnerDropDownItemStyle" parent="android:TextAppearance.Widget.TextView.SpinnerItem">
</style>
从here
这是你可以使用所有意见的最佳工具,并采取了它的免费
Android的全息色彩生成器允许您轻松地创建Android组件如editext
或微调用你自己的颜色为你的Android应用程序。它将生成所有必需的九个修补程序资产以及可以直接复制到项目中的相关XML可绘制和样式。
尝试
这一形象摆在EditText
背景,做作为同为Spinner
注:选择颜色微调此工具
android:background="@drawable/textfield_activated"
为Spinner和EditText设置背景将帮助您弄清楚。
<Spinner android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/spinner_bg"/>
<EditText android:id="@+id/edittext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_bg"/>
</LinearLayout>
它真的帮助! – mohsen 2014-09-03 04:38:56
现在我可以指导你的EditText节..
定义你的风格绘制这样的..
RES /绘制/ edit_text_style.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape >
<solid android:color="@color/wine_red" />
</shape>
</item>
<!-- main color -->
<item android:bottom="1.5dp"
android:left="1.5dp"
android:right="1.5dp">
<shape >
<solid android:color="@color/white" />
</shape>
</item>
<!-- draw another block to cut-off the left and right bars -->
<item android:bottom="5.0dp">
<shape >
<solid android:color="@color/white" />
</shape>
</item>
</layer-list>
现在在你的EditText中像这样定义它..
<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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.vivektest.MainActivity" >
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<EditText
android:background="@drawable/edit_text_style"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/et_main"
android:imeOptions="actionSearch"
android:singleLine="true"
/>
</RelativeLayout>
希望它有帮助!
http://android-holo-colors.com/ – MilapTank 2014-09-02 12:07:25