校園資訊平台部分頁面開發技術報告

2021-10-08 19:14:32 字數 3788 閱讀 6772

首先是開發使用者註冊頁面,以繼承方式引用部分介面。這部分介面連線到伺服器。還處理了註冊中部分異常。

public

class

sign_in

extends

trycatch

(exception e)

設計螢幕相關的輔助類

這部主要在網上查詢已有**並進行更改。

public

class

screenutils

/** * 獲得螢幕高度

** @param context

* @return

*/public

static

intgetscreenwidth

(context context)

/** * 獲得螢幕寬度

** @param context

* @return

*/public

static

intgetscreenheight

(context context)

/** * 獲得狀態列的高度

** @param context

* @return

*/public

static

intgetstatusheight

(context context)

catch

(exception e)

return statusheight;

}/**

* 獲取當前螢幕截圖,包含狀態列

** @param activity

* @return

*/public

static bitmap snapshotwithstatusbar

(activity activity)

/** * 獲取當前螢幕截圖,不包含狀態列

** @param activity

* @return

*/public

static bitmap snapshotwithoutstatusbar

(activity activity)

}

public

class

page4

extends

textview typetext =

findviewbyid

(r.id.textview4_1)

; textview nametext =

findviewbyid

(r.id.textview4_2)

; textview maintext =

findviewbyid

(r.id.textview4_3)

; textview phonetext =

findviewbyid

(r.id.textview4_4)

;final imageview im**iew =

findviewbyid

(r.id.imageview4_1)

;final globalvalue ** =

(globalvalue)()

; typeface tf4= typeface.

createfromasset

(getassets()

,"fonts/xk.ttf");

// 通過自定義字型生成字型物件

phonetext.

settypeface

(tf4)

;// 將textview設定自定義字型。

typeface tf3 = typeface.

createfromasset

(getassets()

,"fonts/kt.ttf");

// 通過自定義字型生成字型物件

maintext.

settypeface

(tf3)

;// 將textview設定自定義字型。

typetext.

settext

(**.globaltype.

get(**.

getitemindex()

)); nametext.

settext

("名稱:"

+**.globalname.

get(**.

getitemindex()

)); maintext.

settext

("描述:\n"

+**.globalmain.

get(**.

getitemindex()

)); phonetext.

settext

(+**.globalphone.

get(**.

getitemindex()

));final string lookforpicnum=string.

valueof

(**.

getitemindex()

);log.d(

"looklook"

, lookforpicnum)

;new

thread

(new

runnable()

catch

(exception e)

sc.close()

;//接收

sc =

newsocket

(host, port)

; datainputstream datainput =

newdatainputstream

(sc.

getinputstream()

);int size = datainput.

readint()

;byte

data =

newbyte

[size]

;int len =0;

while

(len < size)

sc.close()

; bytearrayoutputstream output =

newbytearrayoutputstream()

; log.d(

"接收"

,"完成");

final bitmap bmp = bitmapfactory.

decodebytearray

(data,

0, data.length)

;while

(data==null || bmp==null)

bmp.

compress

(bitmap.compressformat.jpeg,

50, output)

; log.d(

"bianma"

,"完成");

handler mainhandler =

newhandler

(looper.

getmainlooper()

);mainhandler.

post

(new

runnable()});

}catch

(exception e)}}

).start()

;}

MVC 母版頁和部分頁面

大體框架 新建一空頁面 編輯模版頁 天涯海閣 br 2015 7 11 td tr table div body html 控制器 using system using system.collections.generic using system.linq using system.web usi...

wordpress 部分頁面開啟顯示連線重置

排查後發現是post name的字段太長導致的,我使用了固定鏈結 post id.html 沒有用post name作為固定連線。想改wp posts 中post name的字段,發現提示post date值 invalid default value for date 找到配置檔案my.cnf 在...

列印功能 列印預覽,列印部分頁面

window.print 預設列印整個頁面,可是我只想列印頁面的部分樣式,最簡單的一種方法是使用 css 的 查詢有針對列印的樣式,用 media print設定列印時除了要列印的內容,其它全部隱藏即可 設定列印樣式 瀏覽器預設情況下並不能列印出css中的背景內容 列印設定使用的是物理單位,所以尺寸...