android UI

A015-佈局之LinearLayout good 巫山老妖php

 Android UI開發: 橫向ListView(HorizontalListView)及一個簡單相冊的完整實現 (附源碼下載)html

Android:控件GridView的使用

Android:將View的內容映射成Bitmap轉圖片導出

android中惡心的getDrawingCache

Android XML shape 標籤使用詳解

 
ShapeDrawable和GradientDrawable的簡單使用java

TabLayout用法詳解及自定義樣式

 

一、咱們只有在button2使用了layout_weight屬性,並賦值爲1;可是button1和button2並無使用這個屬性,根據API能夠知道,他們的layout_weight屬性等於0。android

二、LinearLayout若是顯式包含layout_weight屬性時,會measure兩次;第一次將正常計算三個button的寬高,第二次將結合layout_weight的值分配剩餘的空間。git

  通俗點來總結:Android系統先按照你設置的3個Button高度Layout_height=wrap_content,給你分配好他們3個的高度,而後會把剩下來的屏幕空間所有賦給Button2,由於只有他的權重值是1,這也是爲何Button2佔了那麼大的一塊空間。程序員

在layout_width設置爲match_parent的時候,layout_weight所表明的是你的控件要優先儘量的大,但這個大是有限度的,即match_parent。
在layout_width設置爲wrap_content的時候,layout_weight所表明的是你的控件要優先儘量的小,但這個大是有限度的,即wrap_content。github

android:layout_weight的真實含義

android:layout_weight的真實含義是:一旦View設置了該屬性(假設有效的狀況下),那麼該 View的寬度等於原有寬度(android:layout_width)加上剩餘空間的佔比!ide

Android百分比佈局之layout_weight屬性

android佈局--Android fill_parent、wrap_content和match_parent的區別

三個屬性都用來適應視圖的水平或垂直大小,一個以視圖的內容或尺寸爲基礎的佈局比精確地指定視圖範圍更加方便。佈局

1)fill_parentpost

設置一個構件的佈局爲fill_parent將強制性地使構件擴展,以填充佈局單元內儘量多的空間。這跟Windows控件的dockstyle屬性大致一致。設置一個頂部佈局或控件爲fill_parent將強制性讓它佈滿整個屏幕。

2) wrap_content

設置一個視圖的尺寸爲wrap_content將強制性地使視圖擴展以顯示所有內容。以TextView和ImageView控件爲例,設置爲wrap_content將完整顯示其內部的文本和圖像。佈局元素將根據內容更改大小。設置一個視圖的尺寸爲wrap_content大致等同於設置Windows控件的Autosize屬性爲True。

3)match_parent
   Android2.2中match_parent和fill_parent是一個意思 .兩個參數意思同樣,match_parent更貼切,因而從2.2開始兩個詞均可以用。那麼若是考慮低版本的使用狀況你就須要用fill_parent了

 

Android系統自帶樣式(@android:style/) (轉)

Android知識點剖析系列:深刻了解layout_weight屬性

 

ImageView的屬性android:scaleType做用

android:scaleType="fitXY"

《第一行代碼》做者郭霖:從Java程序員到Android開發者的第一步(圖靈訪談)

Android LayoutInflater原理分析,帶你一步步深刻了解View(一) good  第一行代碼做者

Android視圖繪製流程徹底解析,帶你一步步深刻了解View(二) 

onMeasure()、onLayout()和onDraw()

 

Android自定義控件之日曆控件

Android自定義View(CustomCalendar-定製日曆控件) 

Android又一個超漂亮的日曆控件 中文

關於EditText代碼設置焦點及軟鍵盤設置(二)

Android:focusable="true"  
android:focusableInTouchMode="true"  
2.代碼中動態設置:
editText.setFocusable(true);//設置獲取焦點 
但實際應用中setFocusable(true)方法失效!不知道什麼鬼。
後來查文檔,editTextview.requestFocus();//代碼動態設置焦點(實現) 

  

Android代碼設置Shape,corners,Gradient good

 

Android中日曆控件的使用  系統日曆控件

Android開發之日曆控件實現  雙向按鈕

Othershe/CalendarView github code

Android 一個日曆控件的實現代碼

Android 多種簡單的彈出框樣式設置 good

 

java的Date類的getYear(),getMonth過期方法的替換  

 

推薦安卓開發神器–23code客戶端(裏面有各類UI特效和android代碼庫實例)

 

Android小技巧——EditText 

findViewById在Activity和View中的區別  good 

View contentView = getLayoutInflater().inflate(R.layout.popup, null);  

android button屬性

Android 字體設置-Typeface講解

 

 

Android ComboBox -- Spinner基礎使用

 

Android ComboBox

該控件主要實現方式爲Button 從寫 + PopupWindow ListView 組合

 

Android Button有默認padding值的元兇!!!

public Button(Context context, AttributeSet attrs) { this(context, attrs, com.android.internal.R.attr.buttonStyle); }

 

AS問題解決系列2—Resources中getDrawable(int)過期

 

 Android EditText 改變邊框顏色 good

 

Android如何製做漂亮的自適佈局的鍵盤

xml 技巧

Android EditText 改變邊框顏色

給EditText設置邊框

<?xml version="1.0" encoding="utf-8"?>
<layer-list
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">
            <solid
                android:color="#EFEFEF"/>
            <corners
                android:radius="3dip"
                />
            <stroke
                android:width="0.5px"
                android:color="#505050"/>
        </shape>
    </item>
</layer-list>


自定義鍵盤代碼

Android 獲取TextView焦點後自動彈出軟鍵盤

原創 2017年01月15日 04:37:07

有時候咱們跳轉到某些頁面時,但願能立刻獲取特定TextView的焦點並彈出軟鍵盤

 

		editText.setFocusable(true);
		editText.requestFocus();
		InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.toggleSoftInput(0,InputMethodManager.HIDE_NOT_ALWAYS);


[android]自定義軟鍵盤KeyBoardView的基本實現

  

Android使用xml自定義軟鍵盤效果(附源碼)

相關文章
相關標籤/搜索