android:布局中加入分割线水平线竖直线的View

2015年11月20日 Android 5条评论 阅读6247次

android布局中,会有两个显示单元之间要用到分割线去隔开的情况。
此时要用到的就是本文说的这种view。


水平分割线

<View
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:background="#000000" />


竖直分割线

<View
    android:layout_width="1dp"
    android:layout_height="match_parent"
    android:background="#000000" />


另外还可以引用android自带的一个样式来声明这是一条分割线

<View
    android:layout_width="1dp"
    android:layout_height="match_parent"
    android:background="?android:attr/listDivider" />


本质一样的,只是第三种写法把android:background的属性改为了?android:attr/listDivider。
灵活性来说感觉还是自己写android:background的属性比较好了。



分享本文至:

WRITTEN BY

avatar
本文标签:分割线
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

5 条评论

  1. avatar adanastarpen

    <a href="http://www.cardiachits.com/nike-kobe-10-elite-pink-shoesj">nike kobe 10 elite pink</a> <a href="http://www.zestchannel.com/kvinders-nike-free-run-2-guld-appelsin-skoi">kvinders nike free run 2 guld appelsin</a> <a href="http://www.eczacinim.com/femminile-nike-lebron-13-blu-bianca-scarpel">femminile nike lebron 13 blu bianca</a> <a href="http://www.chilangorails.com/womens-nike-blazer-grey-gold-shoesj">womens nike blazer grey gold</a> <a href="http://www.mariusen.com/michael-kors-jet-set-travel-tote-medium-black-mkh">michael kors jet set travel tote medium black</a> <a href="http://www.brittonoilco.com/kvinners-nike-air-max-90-oransje-r%C3%B8d-obuvi">kvinners nike air max 90 oransje r酶d</a>
    adanastarpen http://www.adanastarpen.com/

  2. avatar nike coaches hat

    <a href="http://www.ipodammo.com/nike-blazer-mid-metric-svart-obuvi">nike blazer mid metric svart</a> <a href="http://www.bezpozyczka.com/nike-dunks-viola-scarpek">nike dunks viola</a> <a href="http://www.ajhoweaboutpt.com/nike-lab-air-max-270-green-black-white-vert-noir-blanc-shoesi">nike lab air max 270 green black white vert noir blanc</a> <a href="http://www.rawrapture.com/jordan-12-future-teal-azul-zapatosi">jordan 12 future teal azul</a> <a href="http://www.staholidays.com/converse-alle-star-gr%C3%A5-lyser%C3%B8d-skoh">converse alle star gr氓 lyser酶d</a> <a href="http://www.gunsrusoregon.com/gray-and-bianca-converse-scarpei">gray and bianca converse</a>
    nike coaches hat http://www.bestzixiutang.com/nike-coaches-hat-hatl

  3. avatar isampled

    <a href="http://www.laketreepress.com/nike-roshe-two-flyknit-lila-grau-schuheh">nike roshe two flyknit lila grau</a> <a href="http://www.prohaarklinik.com/kvinners-air-jordan-retro-7-gr%C3%B8nn-oransje-obuvj">kvinners air jordan retro 7 gr酶nn oransje</a> <a href="http://www.bonfanticare.com/maschio-asics-gel-kayano-21-blu-rosso-scarpek">maschio asics gel kayano 21 blu rosso</a> <a href="http://www.antoniopagni.com/air-jordan-retro-14-royal-bleu-argent-chaussuresh">air jordan retro 14 royal bleu argent</a> <a href="http://www.wcshosting.com/prada-br4391-handbags-in-black-pradah">prada br4391 handbags in black</a> <a href="http://www.biddingstream.com/2016-chicago-bulls-jersey-nfli">2016 chicago bulls jersey</a>
    isampled http://www.isampled.com/

  4. avatar notmyrichie

    <a href="http://www.cardiachits.com/air-jordan-retro-31-all-green-shoesj">air jordan retro 31 all green</a> <a href="http://www.zestchannel.com/kvinders-air-jordan-13-bl%C3%A5-skop">kvinders air jordan 13 bl氓</a> <a href="http://www.eczacinim.com/mennns-nike-flyknit-roshe-run-r%C3%B8d-lilla-obuvk">mennns nike flyknit roshe run r酶d lilla</a> <a href="http://www.chilangorails.com/nike-zoom-structure-20-grey-blue-shoesi">nike zoom structure 20 grey blue</a> <a href="http://www.mariusen.com/herre-air-max-90-hyperfuse-appelsin-skoj">herre air max 90 hyperfuse appelsin</a> <a href="http://www.brittonoilco.com/mennns-nike-free-run-3-all-gr%C3%A5-obuvi">mennns nike free run 3 all gr氓</a>
    [url=http://www.notmyrichie.com/]notmyrichie[/url]

  5. avatar bkindvending

    <a href="http://www.poppiesdelray.com/women-air-jordan-retro-12-low-white-blue-shoesk">women air jordan retro 12 low white blue</a> <a href="http://www.soundsofbuzz.com/nike-air-trainer-huarache-triple-sort-nice-kicks-skoj">nike air trainer huarache triple sort nice kicks</a> <a href="http://www.hozloli.com/m%C3%A4nner-nike-air-max-tailwind-5-grau-gr%C3%BCn-schwarz-schuheh">m盲nner nike air max tailwind 5 grau gr眉n schwarz</a> <a href="http://www.privetaustria.com/adidas-tubular-primeknit-grey-shoesk">adidas tubular primeknit grey</a> <a href="http://www.goodnnasty.com/michael-michael-kors-jet-set-large-east-west-crossbody-mkh">michael michael kors jet set large east west crossbody</a> <a href="http://www.ankarasanal.com/air-jordan-eclipse-lilla-gr%C3%B8nn-obuvi">air jordan eclipse lilla gr酶nn</a>
    bkindvending http://www.bkindvending.com/

欢迎留言




用户登录

sitemap