[英]How can I reduce the space between text and image on a button on android
[英]Reduce space between spinner item
任何人都可以提出如何減少帶有單選按鈕的微調器項目之間高度的空間。
我的代碼如下。
布局
<Spinner android:layout_width="250dp"
android:layout_height="40dp"
android:id="@+id/spinnerCompany"
android:theme="@style/SpinnerTheme"
android:background="@android:drawable/btn_dropdown" />
微調主題
<style name="SpinnerTheme">
<item name="android:layout_width" >fill_parent</item>
<item name="android:textSize" >15dp</item>
<item name="android:layout_width" >fill_parent</item>
<!--<item name="colorAccent">#00f</item>
<item name="colorControlNormal">#00f</item>-->
</style>
活動代碼
ArrayAdapter CompanyAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, cls_static.ToArrayList(ListofCompnyFromDB));
CompanyAdapter.SetDropDownViewResource(Android.Resource.Layout.SelectDialogSingleChoice);
spinnerCompanyObj.Adapter = (CompanyAdapter);
獲得像下面任何幫助的輸出將不勝感激。
我做了如下較小的更改,它得到解決。
活動
CompanyAdapter.SetDropDownViewResource(Resource.Drawable.styl_spinner_style);
styl_spinner_style
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/spinnerDropDownItemStyle"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="37dp"
android:ellipsize="marquee"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:textColor="#252c3b"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.