1. 程式人生 > >Android LinearLayout : Add border with shadow around a line

Android LinearLayout : Add border with shadow around a line

As an alternative, you might use a 9 patch image as the background for your layout, allowing for more "natural" shadows:

enter image description here

Result:

enter image description here

Put the image in your /res/drawable folder.
Make sure the file extension is .9.png, not .png

By the way, this is a modified (reduced to the minimum square size) of an existing resource found in the API 19 sdk resources folder.
I left the red markers, since they don't seem to be harmful, as shown in the draw9patch tool.

[EDIT]

About 9 patches, in case you never had anything to do with them.

Simply add it as the background of your View.

The black-marked areas (left and top) will stretch (vertically, horizontally).
The black-marked areas (right, bottom) define the "content area" (where it's possible to add text or Views - you can call the unmarked regions "padding", if you like to).

相關推薦

Android LinearLayout : Add border with shadow around a line

As an alternative, you might use a 9 patch image as the background for your layout, allowing for more "natural" shadows: Result: Put the image in your /

Android View的圓角和陰影(border and shadow)

專案準備實現效果如下: 圓角邊框實現比較容易,定義shape.xml作為View的background即可 <?xml version= "1.0" encoding= "utf-8"?> <shape xmlns:android="http://sc

add Admob with Cocos2d-x on iOS

nsobject code earch stack orm urn plain rda ima add Admob with Cocos2d-x on iOS (2013-02-27 14:12:00) 轉載▼ 標簽:

[轉]Android Studio啟動時出現unable to access android sdk add-on list

上大 ras server tails dea tar ext ida 錯誤信息 轉載請標明出處:http://blog.csdn.net/xx326664162/article/details/50563122 文章出自:薛瑄的博客 你也可以查看我的其他同類文章,也會讓你

打開Android Studio時報Unable to access Android SDK add-on list

打開 title 而且 tex 技術 src access -o 下載安裝 第一次安裝Android studio時候彈出unable to access android sdk add-on list原因是你電腦沒有SDK而且你下載的android studio又是不

Android: Only the original thread that created a view hierarchy can touch its views 異常

action 接收 如果 exc void 簡單使用 idg ror ucc 最近自己再寫一個小項目練手,創建一個線程從網絡獲取數據然後顯示在 recyclerView 上。寫好後發現頁面能夠顯示,但是有時候會把請求的數據顯示過來,有時候不會。點開 android moni

Draw a line segment with PyOpenGL

cos glcolor3f window errors == 1.0 pri locals vertex Hardware:   Memory: 11.7 GiB   Processor: Intel? Core? i5-3570 CPU @ 3.40GHz × 4  

jdk的設置及安裝android studio提示does not point to a valid jvm問題

ould cap jvm stack 8.0 環境變量設置 comment eal ltr jdk的設置及安裝android studio提示does not point to a valid jvm問題 設置方法: 我的電腦->屬性->高級->環

OperationFailed Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit

imu command mongo sed 大內存 gson style fan index   按照錯誤提示,知道這是排序的時候報的錯,因為 mongo 的 sort 操作是在內存中操作的,必然會占據內存,同時mongo 內的一個機制限制排序時最大內存為 32M,當排序的

Mercedes W215 all keys lost: add key with VVDI Prog + VVDI MB

MB BGA TooL VVDI MB BGA tool VVDI PROG vvdi prog programmer xhorse vvdi prog Here is a customer solution: how to add new keys to Mercede

Solution of issue: Android soft keyboard overlap with input div on browser【Android虛擬鍵盤與輸入框重疊解決方案】

Android soft keyboard overlap with input div on browser 【Android虛擬鍵盤與輸入框重疊】 給個英文標題,因為我知道絕大部分人搜資料都用英文搜。 問題: 在Android裝置瀏覽器上開啟自己的頁面,當點選頁面底部的輸入框時,虛擬

How to Add “Open with Notepad” to the Windows Context Menu for All Files

If you want to open a file type not registered with Notepad, you have to click through several options to make it happen. This can be a hassle, so

android LinearLayout佈局巢狀覆蓋問題

在做android  UI佈局時,用了LinearLayout巢狀,發現效果並不如我預料一般 查了下資料,說是要設定layout_weight屬性 資料說得不是很清楚,也沒仔細看,就去弄,結果越弄越混亂。 於是靜下心來,自己寫xml測試,發現如下。 我用eclipse開發,

A problem occurred starting process 'command 'E:\android\sdk\ndk-bundle\toolchains\mips64el-linux-a

Execution failed for task ':app:transformNativeLibsWithStripDebugSymbolForDebug'. > A problem occurred starting process 'command 'E:\android\sdk\n

第一次安裝Android studio時候彈出unable to access android sdk add-on list

第一次安裝Android studio時候彈出unable to access android sdk add-on list原因是你電腦沒有SDK而且你下載的android studio又是不帶SDK的; 解決方法:在自己安裝的目錄下找到:bin\id

Quantum Bits Store Dat 4g LTE router with SIM card a for Nearly Two Seconds Using Laboratory Grownsm

www.inhandnetworks.com Mikhail Lukin (from left), Georg Kucsko, and Christian Latta are part of a group of Harvard scientists who were able to c

android 報錯 This Gradle plugin requires a newer IDE able to request IDE model level 3 錯誤解決方案

轉載自: https://blog.csdn.net/JtooZC/article/details/79422323   android studio  匯入專案時報錯 This Gradle plugin requires a newer IDE able

unable to access android sdk add-on list

class info 由於 安裝 原因 手動 我們 方案 huang 在安裝 Android Studio 的時候,會出現這個問題。 Android Studio First Run 檢測 Android SDK 及更新,由於眾所周知的原因,我們會「Unable to a

Sync android SDKs path does not belong to a directory

這個問題其實可以忽略的,這個只是 Android studio 的提示資訊而已的。 即匯入的專案 的 SDK路徑和 studio預設使用的不同。 就會使用 studio 的SDK路徑。 不用理會即可。 匯入成功之後 studio 會修改 local.properties 

unable to access android sdk add-on listS

2018年07月27日 18:28:58 言寡 閱讀數:27 2016年01月22日 17:01:15 閱讀數:144125 造成這個問題的原因可能有多種,下面兩種方法,我親自測試後可用,如果都不行,請在評論裡告訴我,我會盡快幫你分析解決。左側的文章分類中,A