android 帶文字陰影的按鈕,android陰影

來源:互聯網
上載者:User

android 帶文字陰影的按鈕,android陰影

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical" >    <!-- 文字陰影的按鈕 -->    <Button android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="文字帶陰影的按鈕"        android:textSize="12sp"        android:shadowColor="#aa5"        android:shadowRadius="1"        android:shadowDx="5"        android:shadowDy="5"        /></LinearLayout>


Android,讓按鈕下的文字置中?

  TextView 下 加個橫向置中屬性 android:layout_centerHorizontal="true"
  <LinearLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="horizontal" >

  <RelativeLayout
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  android:layout_weight="1" >

  <Button
  android:id="@+id/btn1"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_centerHorizontal="true" />

  <TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_below="@id/btn1"
  android:layout_centerHorizontal="true"
  android:text="aaaaaa" />
  </RelativeLayout>

  <RelativeLayout
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  android:layout_weight="1" >

  <Button
  android:id="@+id/btn2"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_centerHorizontal="true" />

  <TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_below="@id/btn2"
  android:layout_centerHorizontal="true"
  android:text="bbbbbbb" &#......餘下全文>>
 
在android開發中為何我的圖片按鈕上的文字不置中 都設了這些屬性

代碼沒問題。可能是.9圖片設定的要顯示的地區不是長寬對稱的,我以前碰到就是這個原因造成的,你可以換張不是.9的圖片試下,如果問題解決了,說明那肯定是.9的圖片的原因了
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.