① android studio Listview如何讓文字覆蓋在圖片上
這個應該是布局的問題吧,使用相對布局,先定義圖片(imageview),然後再定義文字(textview)
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/home2"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="這是一個測試數據"
/>
向這樣文字就在圖片上面
② android開發中如何進行圖片布局的
如果button的背景是常規按鈕背景的樣子,就是有規律的,可以有一部分拉伸,一部分不拉伸,是正常的展示效果的話,比如說上下是對照的,就把這個背景圖片做成.9.png就可以滿足你的需要,一般都可以這樣做;還一種情況就是這個圖片背景,是完全沒有規律,比如一個人物畫像之類的,就在drawable-hdpi,和drawable-xxhdpi裡面放不同解析度的背景圖片,命名成一樣的,他會自己適配的
③ android在一張圖片相應位置顯示字的布局
1、在一張圖片的任意位置顯示文字,使用RelativeLayout布局,俗稱相對布局,是在Android開發中使用得最多的一種布局方式,比如在圖片的下邊欄顯示一行文字,代碼如下:
<ImageView
android:id="@+id/imageview_001"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:src="@drawable/ic_launcher"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginTop="100dp"
/>
更多Android例子,網路一下就知道了,平時也做點學習,TeachCourse比較適合初學者,謝謝採納!
④ Android開發中如何改變RadioButton背景圖片和文字的相對位置
先看看效果圖:
Android系統中,RadioButton控制項默認的布局方式是背景圖在左,文字說明在右。
在具體的項目開發中,有時候需要調整二者之間的相對位置,比如:RadioButton的說明文字在上,RadioButton的背景圖片在下。
Android開發中如何改變RadioButton背景圖片和文字的相對位置呢?
現在以RadioButton的說明文字在上,RadioButton的背景圖片在下為例進行編碼實現。
具體代碼的實現:
.....
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:button="@null"
android:paddingLeft="5dp"
android:textSize="10dip"
android:drawableBottom="@android:drawable/btn_radio"
android:text="@string/_str"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:button="@null"
android:paddingLeft="5dp"
android:textSize="10dip"
android:drawableBottom="@android:drawable/btn_radio"
android:text="@string/_str"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:button="@null"
android:textSize="10dip"
android:paddingLeft="1dp"
android:paddingRight="5dp"
android:drawableBottom="@android:drawable/btn_radio"
android:text="@string/_str"/>
.....
代碼解釋:
android:button="@null"
這句是將RadioButton的背景圖屏蔽。
android:drawableBottom="@android:drawable/btn_radio"
此句用意是在原來圖標的下邊使用系統自帶的btn_radio圖片做為背景圖
⑤ android那種文字在圖標下方的界面是怎樣布局出來的,就是像這個的
這個是採用gridview布置的。首先你先定義一個gridview網格內的布局gridview.xml。然後再設置一個adapter來關聯你的資源文件和布局文件。然後在設置gridview的adapter。
這樣子說太麻煩,我看看我還有沒有源代碼,有的話發給你。沒有的話,你可能要等一等了。
⑥ android中圖片和文字怎樣才能在一行
沒錯,線性布局,貼段我寫的代碼給你吧。。可以實現,比較簡陋~哈哈:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="聲音模式:"/>
<ImageView
android:id="@+id/myImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
主要是horizontal~嵌套在垂直的線性布局裡面。這樣就可以接著在下面嵌套個水平的線性布局
⑦ android不同屏幕圖片的文字布局
相對布局 android:layout_below 將該控制項的頂部至於給定ID的控制項之下
⑧ android 文字和圖片對不齊
推薦:
GridView做外部父控制項;
中間的item線性布局,由ImageView和TextView構成。
在線性布局中加入屬性居中即可。
Ps:如果你是單獨加了6對ImageView和TextView,那麼我建議試一下在TextView里加入gravity和layout_gravity屬性居中。