導航:首頁 > 操作系統 > android文字圖片布局

android文字圖片布局

發布時間:2022-10-24 00:23:09

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 文字和圖片對不齊

推薦:

  1. GridView做外部父控制項;

  2. 中間的item線性布局,由ImageView和TextView構成。

  3. 在線性布局中加入屬性居中即可。

Ps:如果你是單獨加了6對ImageView和TextView,那麼我建議試一下在TextView里加入gravity和layout_gravity屬性居中。

閱讀全文

與android文字圖片布局相關的資料

熱點內容
伺服器未響應怎麼解決手機 瀏覽:184
程序員回到古代 瀏覽:402
軟體合並一個文件夾 瀏覽:657
設置Android程序圖標 瀏覽:365
app哪個局 瀏覽:904
源碼編輯器中怎麼保存 瀏覽:463
python背景圖片代碼 瀏覽:448
3D卡片下載哪個App 瀏覽:532
如何用伺服器登錄微信 瀏覽:841
html5移動開發pdf下載 瀏覽:525
如何查看png圖片是否加密 瀏覽:821
php遞歸例子 瀏覽:190
伺服器參數配置未響應是什麼意思 瀏覽:603
pythonchardet模塊 瀏覽:751
添加gm命令 瀏覽:662
rsa加密碼亂碼 瀏覽:758
網站伺服器需要租什麼 瀏覽:999
c語言常用排序演算法 瀏覽:824
pythonhtml文件上傳 瀏覽:525
dosat命令執行exe 瀏覽:95