第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何創(chuàng)建標(biāo)準(zhǔn)的無邊框按鈕(如上述設(shè)計指南中所述)?

如何創(chuàng)建標(biāo)準(zhǔn)的無邊框按鈕(如上述設(shè)計指南中所述)?

寶慕林4294392 2019-10-23 15:28:17
我只是查看設(shè)計指南,想知道無邊界按鈕。我凝視了一下,試圖在源中查找,但我自己無法將其組合在一起。這是普通的Button小部件,但是您添加了自定義(Android默認(rèn))樣式?如何制作這些無邊界按鈕(當(dāng)然您可以將背景設(shè)置為空,但是我沒有分隔線)?這里鏈接到設(shè)計指南:http://developer.android.com/design/building-blocks/buttons.htmlhttp://developer.android.com/guide/topics/ui/controls/button.html#Borderless
查看完整描述

3 回答

?
慕妹3242003

TA貢獻(xiàn)1824條經(jīng)驗 獲得超6個贊

為了消除一些混亂:


這需要2個步驟:將button background屬性設(shè)置為android:attr / selectableItemBackground會創(chuàng)建一個帶有反饋但沒有背景的按鈕。


android:background="?android:attr/selectableItemBackground"

將無邊界按鈕與其余布局分開的行是通過背景為android:attr / dividerVertical的視圖完成的


android:background="?android:attr/dividerVertical"

為了更好地理解,此處是屏幕底部的“確定” /“取消無邊界”按鈕組合的布局(如上圖所示)。


<RelativeLayout

        android:layout_width="match_parent"

        android:layout_height="48dp"

        android:layout_alignParentBottom="true">

        <View

            android:layout_width="match_parent"

            android:layout_height="1dip"

            android:layout_marginLeft="4dip"

            android:layout_marginRight="4dip"

            android:background="?android:attr/dividerVertical"

            android:layout_alignParentTop="true"/>

        <View

            android:id="@+id/ViewColorPickerHelper"

            android:layout_width="1dip"

            android:layout_height="wrap_content"

            android:layout_alignParentTop="true"

            android:layout_alignParentBottom="true"

            android:layout_marginBottom="4dip"

            android:layout_marginTop="4dip"

            android:background="?android:attr/dividerVertical" 

            android:layout_centerHorizontal="true"/>

        <Button

            android:id="@+id/BtnColorPickerCancel"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_alignParentLeft="true"

            android:layout_alignParentTop="true"

            android:layout_toLeftOf="@id/ViewColorPickerHelper"

            android:background="?android:attr/selectableItemBackground"

            android:text="@android:string/cancel" 

            android:layout_alignParentBottom="true"/>

        <Button

            android:id="@+id/BtnColorPickerOk"

            android:layout_width="wrap_content"

            android:layout_height="match_parent"

            android:layout_alignParentRight="true"

            android:layout_alignParentTop="true"

            android:background="?android:attr/selectableItemBackground"

            android:text="@android:string/ok" 

            android:layout_alignParentBottom="true" 

            android:layout_toRightOf="@id/ViewColorPickerHelper"/>

    </RelativeLayout>


查看完整回答
反對 回復(fù) 2019-10-23
?
繁花如伊

TA貢獻(xiàn)2012條經(jīng)驗 獲得超12個贊

對于那些想要無邊界按鈕但在單擊時仍保持動畫效果的人。在按鈕中添加它。


style="?android:attr/borderlessButtonStyle"

如果需要分隔線/它們之間的線。將其添加到線性布局中。


style="?android:buttonBarStyle"

摘要


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

   android:layout_width="fill_parent"

   android:layout_height="wrap_content"

   android:orientation="horizontal"

   style="?android:buttonBarStyle">


    <Button

        android:id="@+id/add"

        android:layout_weight="1"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:text="@string/add_dialog" 

        style="?android:attr/borderlessButtonStyle"

        />


    <Button

        android:id="@+id/cancel"

        android:layout_weight="1"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:text="@string/cancel_dialog" 

        style="?android:attr/borderlessButtonStyle"

        />


</LinearLayout>


查看完整回答
反對 回復(fù) 2019-10-23
  • 3 回答
  • 0 關(guān)注
  • 350 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號