![tableViewCell下劃線長度設置為屏幕的寬分析_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/16/abd56e61-760d-43ba-8eb3-86f16fca42fc/abd56e61-760d-43ba-8eb3-86f16fca42fc1.gif)
![tableViewCell下劃線長度設置為屏幕的寬分析_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/16/abd56e61-760d-43ba-8eb3-86f16fca42fc/abd56e61-760d-43ba-8eb3-86f16fca42fc2.gif)
![tableViewCell下劃線長度設置為屏幕的寬分析_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/16/abd56e61-760d-43ba-8eb3-86f16fca42fc/abd56e61-760d-43ba-8eb3-86f16fca42fc3.gif)
![tableViewCell下劃線長度設置為屏幕的寬分析_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/16/abd56e61-760d-43ba-8eb3-86f16fca42fc/abd56e61-760d-43ba-8eb3-86f16fca42fc4.gif)
![tableViewCell下劃線長度設置為屏幕的寬分析_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/16/abd56e61-760d-43ba-8eb3-86f16fca42fc/abd56e61-760d-43ba-8eb3-86f16fca42fc5.gif)
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、tableViewCell 下劃線 長度設置為屏幕的寬 ,tableviewcell重疊問題 自己小提示 tableview頭視圖,無限滾動 ,table使用xib的簡單例子 touchesBegan 點擊事件 View UIAlertController與UIPickerView完美結合. if(UartState = UART0_TX) /讀傳感器,控制LED,繼電器,自動刷新 /判斷接收的數(shù)據(jù)合法性 if(RxData0='L'&&RxData1='S') /數(shù)據(jù)合法 if(RxData2 = '1') /讀操作 if(Rx
2、Data3 = '1') /讀煙霧傳感器數(shù)據(jù) readSmoking(); if(RxData3 = '2') /讀光敏傳感器數(shù)據(jù) readSun(); if(RxData3 = '3') /讀溫濕傳感器數(shù)據(jù) readTempHumidity(); if(RxData3 = '6') /讀人體紅外 readMan(); if(RxData3 = '7') /啟動或關閉自動更新 readStAutoUpdate(); if(RxData2 = '0') /寫操作 if(RxData3 = '4
3、') /寫LED if(RxData4 = '1') /寫LED1 if(RxData6 = '1') LED1 = ON; P1DIR &= 0xFE; /設置LED1為輸入口,讀LED1數(shù)據(jù),判斷是否打開成功/tableView 滾動 到哪一行 選中哪一行 /SYPhotoPicker photo photoPicker 相冊讀. while(LED1 != 1); P1DIR |= 0x1; TxData2 = '4' TxData3 = '1' TxData4 = '0' TxData5 =
4、 '0' TxData6 = '1' UartSendString(TxData, 8); else LED1 = OFF; P1DIR &= 0xFE; /設置LED1為輸入口,讀LED1數(shù)據(jù),判斷是否打開成功 while(LED1 = 1); P1DIR |= 0x1; TxData2 = '4' TxData3 = '1' TxData4 = '0' TxData5 = '0' TxData6 = '1' UartSendString(TxData, 8); if(Rx
5、Data4 = '2') /寫LED2 if(RxData6 = '1') LED2 = ON; P1DIR &= 0xFD; /設置LED2為輸入口,讀LED2數(shù)據(jù),判斷是否打開成功 while(LED2 != 1); P1DIR |= 0x2; TxData2 = '4' TxData3 = '2' TxData4 = '0' TxData5 = '0' TxData6 = '1' UartSendString(TxData, 8); else LED2 = OFF; P
6、1DIR &= 0xFD; /設置LED2為輸入口,讀LED2數(shù)據(jù),判斷是否打開成功 while(LED2 = 1); P1DIR |= 0x2; TxData2 = '4' TxData3 = '2' TxData4 = '0' TxData5 = '0' TxData6 = '1' UartSendString(TxData, 8); if(RxData4 = '3') /寫LED3 if(RxData6 = '1') LED3 = ON; P1DIR &= 0x
7、EF; /設置LED3為輸入口,讀LED3數(shù)據(jù),判斷是否打開成功 while(LED3 != 1); P1DIR |= 0x10; TxData2 = '4' TxData3 = '3' TxData4 = '0' TxData5 = '0' TxData6 = '1' UartSendString(TxData, 8); else LED3 = OFF; P1DIR &= 0xEF; /設置LED3為輸代碼 Google Go代碼 package mainimport ( "io/ioutil&
8、quot; "net/http" "net/" "fmt" "encoding/json") /-/ 黃金數(shù)據(jù)調(diào)用示例代碼 聚合數(shù)據(jù)/ 在線接口文檔:www/docs/29/- const APPKEY = "*" /您申請的APPKEY func main() /1.上海黃金交易所 Request1() /2.上海期貨交易所 Request2() /3.銀行賬戶黃金 Request3() /1.上海黃金交易所func Request1() /請求地址 juhe :="web:8080
9、/finance/gold/shgold" /初始化參數(shù) param:=.Values /配置請求參數(shù),方法內(nèi)部已處理encode問題,中文參數(shù)可以直接傳參 param.Set("key",APPKEY) /APP Key param.Set("v","") /JSON格式版本(0或1)默認為0 /發(fā)送請求 data,err:=Get(juhe,param) if err!=nil fmt.Errorf("請求失敗,錯誤信息:rn%v",err) else var netReturn mapstringi
10、nterface json.Unmarshal(data,&netReturn) if netReturn"error_code".(float64)=0 fmt.Printf("接口返回result字段是:rn%v",netReturn"result") /2.上海期貨交易所func Request2() /請求地址 juhe :="web:8080/finance/gold/shfuture" /初始化參數(shù) param:=.Values /配置請求參數(shù),方法內(nèi)部已處理encode問題,中文參數(shù)可以直接傳
11、參 param.Set("key",APPKEY) /APP Key param.Set("v","") /JSON格式版本(0或1)默認為0 /發(fā)送請求 data,err:=Get(juhe,param) if err!=nil fmt.Errorf("請求失敗,錯誤信息:rn%v",err) else var netReturn mapstringinterface json.Unmarshal(data,&netReturn) if netReturn"error_code".(f
12、loat64)=0 fmt.Printf("接口返回result字段是:rn%v",netReturn"result") /3.銀行賬戶黃金func Request3() /請求地址 juhe :="web:8080/finance/gold/bankgold" /初始化參數(shù) param:=.Values /配置請求參數(shù),方法內(nèi)部已處理encode問題,中文參數(shù)可以直接傳參 param.Set("key",APPKEY) /APP Key /發(fā)送請求 data,err:=Get(juhe,param) if err
13、!=nil fmt.Errorf("請求失敗,錯誤信息:rn%v",err) else var netReturn mapstringinterface json.Unmarshal(data,&netReturn) if netReturn"error_code".(float64)=0 fmt.Printf("接口返回result字段是:rn%v",netReturn"result") / get 網(wǎng)絡請求func Get(api string,params .Values)(rsbyte ,err e
14、rror) var *. ,err=.Parse(api) if err!=nil fmt.Printf("解析錯誤:rn%v",err) return nil,err /如果參數(shù)中有中文參數(shù),這個方法會進行Encode .RawQuery=params.Encode() resp,err:=http.Get(.String() if err!=nil fmt.Println("err:",err) return nil,err defer resp.Body.Close() return ioutil.ReadAll(resp.Body) / post
15、 網(wǎng)絡請求 ,params 是.Values類型func Post(api string, params .Values)(rsbyte,err error) resp,err:=http.PostForm(api, params) if err!=nil return nil ,err defer resp.Body.Close() return ioutil.ReadAll(resp.Body)代碼描述:基于GO的黃金數(shù)據(jù)接口調(diào)用代碼實例關聯(lián)數(shù)據(jù):黃金數(shù)據(jù)代碼 C#代碼 using System;using System.Collections.Generic;using System.L
16、inq;using System.Text;using System.Net;using System.IO;using Xfrog.Net;using System.Diagnostics;using System.Web; /-/ 黃金數(shù)據(jù)調(diào)用示例代碼 聚合數(shù)據(jù)/ 在線接口文檔:www/docs/29/ 代碼中JsonObject類下載地址:/download/gcm3206021155665/7458439/- namespace ConsoleAPI class Program static void Main(string args) string appkey = "*&
17、quot; /配置您申請的appkey /1.上海黃金交易所 string 1 = "web:8080/finance/gold/shgold" var parameters1 = new Dictionary<string, string>(); parameters1.Add("key", appkey);/你申請的key parameters1.Add("v" , ""); /JSON格式版本(0或1)默認為0 string result1 = sendPost(1, parameters1, &
18、quot;get"); JsonObject newObj1 = new JsonObject(result1); String errorCode1 = newObj1"error_code".Value; if (errorCode1 = "0") Debug.WriteLine("成功"); Debug.WriteLine(newObj1); else /Debug.WriteLine("失敗"); Debug.WriteLine(newObj1"error_code".Valu
19、e+":"+newObj1"reason".Value); /2.上海期貨交易所 string 2 = "web:8080/finance/gold/shfuture" var parameters2 = new Dictionary<string, string>(); parameters2.Add("key", appkey);/你申請的key parameters2.Add("v" , ""); /JSON格式版本(0或1)默認為0 string resu
20、lt2 = sendPost(2, parameters2, "get"); JsonObject newObj2 = new JsonObject(result2); String errorCode2 = newObj2"error_code".Value; if (errorCode2 = "0") Debug.WriteLine("成功"); Debug.WriteLine(newObj2); else /Debug.WriteLine("失敗"); Debug.WriteLine(ne
21、wObj2"error_code".Value+":"+newObj2"reason".Value); /3.銀行賬戶黃金 string 3 = "web:8080/finance/gold/bankgold" var parameters3 = new Dictionary<string, string>(); parameters3.Add("key", appkey);/你申請的key string result3 = sendPost(3, parameters3, &quo
22、t;get"); JsonObject newObj3 = new JsonObject(result3); String errorCode3 = newObj3"error_code".Value; if (errorCode3 = "0") Debug.WriteLine("成功"); Debug.WriteLine(newObj3); else /Debug.WriteLine("失敗"); Debug.WriteLine(newObj3"error_code".Value+&
23、quot;:"+newObj3"reason".Value); / <summary> / Http (GET/POST) / </summary> / <param name="">請求</param> / <param name="parameters">請求參數(shù)</param> / <param name="method">請求方法</param> / <returns>響應內(nèi)容</re
24、turns> static string sendPost(string , IDictionary<string, string> parameters, string method) if (method.ToLower() = "post") HttpWebRequest req = null; HttpWebResponse rsp = null; System.IO.Stream reqStream = null; try req = (HttpWebRequest)WebRequest.Create(); req.Method = method
25、; req.KeepAlive = false; req.ProtocolVersion = HttpVersion.Version10; req.Timeout = 5000; req.ContentType = "application/x-www-form-encoded;charset=utf-8" byte postData = Encoding.UTF8.GetBytes(BuildQuery(parameters, "utf8"); reqStream = req.GetRequestStream(); reqStream.Write(po
26、stData, 0, postData.Length); rsp = (HttpWebResponse)req.GetResponse(); Encoding encoding = Encoding.GetEncoding(rsp.CharacterSet); return GetResponseAsString(rsp, encoding); catch (Exception ex) return ex.Message; finally if (reqStream != null) reqStream.Close(); if (rsp != null) rsp.Close(); else /
27、創(chuàng)建請求 HttpWebRequest request = (HttpWebRequest)WebRequest.Create( + "?" + BuildQuery(parameters, "utf8"); /GET請求 request.Method = "GET" request.ReadWriteTimeout = 5000; request.ContentType = "text/html;charset=UTF-8" HttpWebResponse response = (HttpWebResponse)
28、request.GetResponse(); Stream myResponseStream = response.GetResponseStream(); StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"); /返回內(nèi)容 string retString = myStreamReader.ReadToEnd(); return retString; / <summary> / 組裝普通文本請求參數(shù)。 / </summa
29、ry> / <param name="parameters">Key-Value形式請求參數(shù)字典</param> / <returns>編碼后的請求數(shù)據(jù)</returns> static string BuildQuery(IDictionary<string, string> parameters, string encode) StringBuilder postData = new StringBuilder(); bool hasParam = false; IEnumerator<KeyVal
30、uePair<string, string>> dem = parameters.GetEnumerator(); while (dem.MoveNext() string name = dem.Current.Key; string value = dem.Current.Value; / 忽略參數(shù)名或參數(shù)值為空的參數(shù) if (!string.IsNullOrEmpty(name)/&& !string.IsNullOrEmpty(value) if (hasParam) postData.Append("&"); postDat
31、a.Append(name); postData.Append("="); if (encode = "gb2312") postData.Append(HttpUtility.Encode(value, Encoding.GetEncoding("gb2312"); else if (encode = "utf8") postData.Append(HttpUtility.Encode(value, Encoding.UTF8); else postData.Append(value); hasParam = t
32、rue; return postData.ToString(); / <summary> / 把響應流轉(zhuǎn)換為文本。 / </summary> / <param name="rsp">響應流對象</param> / <param name="encoding">編碼方式</param> / <returns>響應文本</returns> static string GetResponseAsString(HttpWebResponse rsp, Encoding
33、 encoding) System.IO.Stream stream = null; StreamReader reader = null; try / 以字符流的方式讀取HTTP響應 stream = rsp.GetResponseStream(); reader = new StreamReader(stream, encoding); return reader.ReadToEnd(); finally / 釋放資源 if (reader != null) reader.Close(); if (stream != null) stream.Close(); if (rsp != nul
34、l) rsp.Close(); 代碼 PHP代碼 /* * c遠程傳輸工具 */public function post_c($,$body,$header,$type='POST') $ch = c_init(); c_setopt($ch,COPT_,$); c_setopt($ch,COPT_HEADER,0);/0只要正文 c_setopt($ch,COPT_TIMEOUT,5);/設置超時時間 c_setopt($ch,COPT_CONNECTTIMEOUT,5); /將c_exec()獲取的信息以文件流的形式返回,而不是直接輸出。 c_setopt($ch,COPT
35、_RETURNTRANSFER,1); /增加header頭信息 / array_push($header,'Accept:application/json'); / array_push($header,'Content-Type:application/json'); / array_push($header,'http:multipart/form-data'); if(count($body)>0) c_setopt($ch,COPT_POSTFIELDS,$body); if(count($header)>0) c_seto
36、pt($ch,COPT_HTTPHEADER,$header); /設置上傳文件相關 c_setopt($ch,COPT_FOLLOWLOCATION,true); c_setopt($ch,COPT_MAXREDIRS,3);/遞歸 c_setopt($ch,COPT_SSL_VERIFYPEER,false);/ 對認證證書來源的檢查 c_setopt($ch,COPT_SSL_VERIFYHOST,0);/ 從證書中檢查SSL加密算法 switch ($type) case 'GET': c_setopt($ch,COPT_HTTPGET,1); break; case
37、'POST': c_setopt($ch,COPT_POST,1); break; case 'PUT': c_setopt($ch,COPT_CUSTOMREQUEST,'PUT'); break; case 'DELETE': c_setopt($ch,COPT_CUSTOMREQUEST,'DELETE'); break; /上傳文件相關設置 c_setopt($ch,COPT_ENCODING,'gzip'); c_setopt($ch,COPT_USERAGENT,'SSTS Br
38、owser/1.0'); c_setopt($ch,COPT_USERAGENT,'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)');/ 模擬用戶使用的瀏覽器 if(c_errno($ch) return c_error($ch); $content = c_exec($ch); c_close($ch);/關閉c資源,并且釋放系統(tǒng)資源 $result = json_decode($content,true); if(!empty($result) return $result; else
39、 return $content; 代碼 C/C+代碼 /*編譯指令$ /opt/sybase/OCS-16_0/bin/cpre64 -m teststu.cp$ cc -m64 -g -DSYB_LP64 -I. -I/opt/sybase/OCS-16_0/include teststu.c /opt/sybase/OCS-16_0/include/sybesql.c -L/opt/sybase/OCS-16_0/lib -lsybct64 -lsybtcl64 -lsybcs64 -lsybcomn64 -lsybintl64 -lsybunic64 -rdynamic -ldl -l
40、nsl -lm -o teststu*/#include <stdio.h> /*建立通訊區(qū)域*/EXEC SQL INCLUDE SQLCA;/* * These tokens must be declared in a declare section* because they are used in declare sections below.*/EXEC SQL BEGIN DECLARE SECTION;#define TYPESIZE 13#define TIDSIZE 6EXEC SQL END DECLARE SECTION; #define EOLN '0'/* * Forward declarations of the error and message handlers and* other subroutines called from main().*/void
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年企業(yè)福利協(xié)議范本
- 2025年藥用空心膠囊項目規(guī)劃申請報告模稿
- 2025年區(qū)域一體化發(fā)展戰(zhàn)略規(guī)劃協(xié)議
- 2025年農(nóng)業(yè)產(chǎn)品買賣合同規(guī)范
- 2025年產(chǎn)品分銷權合同
- 2025年公共區(qū)域綠化苗木合同
- 2025年中介企業(yè)勞務合作合同樣本
- 2025年離婚協(xié)議書財產(chǎn)分割及子女撫養(yǎng)策劃大綱
- 2025年港口業(yè)投資項目規(guī)劃申請報告模范
- 2025年聚醚多元醇項目提案報告模稿
- GB 4706.20-2004家用和類似用途電器的安全滾筒式干衣機的特殊要求
- 無紙化會議系統(tǒng)解決方案
- 佛教空性與緣起課件
- 上海鐵路局勞動安全“八防”考試題庫(含答案)
- 《愿望的實現(xiàn)》教學設計
- 效率提升和品質(zhì)改善方案
- 中山大學抬頭信紙中山大學橫式便箋紙推薦信模板a
- 義務教育學科作業(yè)設計與管理指南
- 《汽車發(fā)展史》PPT課件(PPT 75頁)
- 常暗之廂(7規(guī)則-簡體修正)
- 反詐騙防詐騙主題教育宣傳圖文PPT教學課件
評論
0/150
提交評論