寒假學習day10

2022-09-18 09:12:27 字數 1322 閱讀 3398

今天學習了為linearlayout設定分割線。

很多介面開發中都會設定一些下劃線,或者分割線,從而使得介面更加整潔美觀,比如下面的酷狗 **的註冊頁面:

對於這種線,我們通常的做法有兩種①直接在布局中新增乙個view,這個view的作用僅僅是顯示出一條線,**也很簡單:

android:layout_width="match_parent"android:layout_height="1px"android:background="#000000"/>

這個是水平方向上的黑線

②第二種則是使用linearlayout的乙個divider屬性,直接為linearlayout設定分割線 這裡就需要你自己準備一張線的了 1)android:divider設定作為分割線的 2)android:showdividers設定分割線的位置,none(無),beginning(開始),end(結束),middle(每兩個元件間) 3)dividerpadding設定分割線的padding

使用示例:

實現**:

xmlns:android=""xmlns:tools=""android:id="@+id/linearlayout1"android:layout_width="match_parent"android:layout_height="match_parent"android:divider="@drawable/ktv_line_div"android:orientation="vertical"android:showdividers="middle"android:dividerpadding="10dp"tools:context="com.jay.example.linearlayoutdemo.mainactivity">android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="按鈕1"/>android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="按鈕2"/>android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="按鈕3"/>

寒假訓練 day10

自學stl之set 簡介 本質 set和multiset區別 主要詳細講一下排序 set容器預設排序規則為從小到大,下面介紹一下從大到小。示例一set存放內建資料型別 include include using namespace std 仿函式 class mycompare void test0...

python學習 day10 推導式

定義 以下內容僅供個人學習使用,侵刪 usr bin env python coding utf 8 推導式 編寫一些有規律性的 列表推導式 字典推導式 集合推導式 生成器表示式 lst for i in range 1,11 print lst 推導式,從右向左走 1.普通迴圈模式 print i...

閉關日記 Day10

小雨。我想想怎麼寫,先挖坑。d 確認4.1 考科目三,估計過幾天要開始練車了。晚上去工作室敲 剛好看到他們在筆試,明天就是我筆試了,祝一切順利 專案f的電鋸聲識別,開始用比較勉強的方式實現,算是折衷吧,迫於時間,暫時如此,精準的識別想來是我目前做不出來的,如果畢設做這個,倒是也可以好好研究一些聲音方...