亚洲精品免播放器在线观看-久久啊-久久观看视频-日韩精品亚洲专区在线电影不卡-在线观看免费a∨网站-在线观看毛片网站

推廣 熱搜: 廣場(chǎng)  Java  app  Word  營(yíng)業(yè)  微信公眾號(hào)  北京代理記賬  商城  代理記賬  商標(biāo)交易 

css如何動(dòng)態(tài)添加class 在android開(kāi)發(fā)中,怎樣動(dòng)態(tài)生成多界面?

   2023-04-27 企業(yè)服務(wù)招財(cái)貓100
核心提示:在android開(kāi)發(fā)中,怎樣動(dòng)態(tài)生成多界面?效果:layout界面布局:[html]viewplaincopyprintxmlversion1.0encodingutf-8LinearLayoutxm

在android開(kāi)發(fā)中,怎樣動(dòng)態(tài)生成多界面?

效果:layout界面布局:[html]viewplaincopyprintxmlversion1.0encodingutf-8LinearLayoutxmlns:ad_widthmatch_parentad:layout_heightmatch_parentad:orientationverticalLinearLayoutad:layout_widthmatch_parentad:layout_height30dpad:/titlebar_bgad:orientationhorizontalImageViewad:layout_widthwrap_contentad:layout_heightwrap_contentad:/back_44_44/LinearLayoutad:layout_widthmatch_parentad:layout_height30dpad:gravitycenterTextViewad:layout_widthwrap_contentad:layout_heightwrap_contentad:text課程列表ad:textSize20sp//LinearLayout/LinearLayoutScrollViewad:id@id/ScrollViewad:layout_widthfill_parentad:layout_heightwrap_contentad:scrollbarsverticalLinearLayoutad:id@id/mainLayoutad:layout_widthmatch_parentad:layout_heightwrap_contentad:orientationvertical/LinearLayout/ScrollView/LinearLayouthttputil輔助類(lèi):

[java]viewplaincopyprintpackage;import;import;import;import;import;import;import;importandroid.util.Log;publicclassHttpUtil{publicstaticInputStreamgetInputStream(Stringpath){HttpURLConnectionconnnull;try{URLurlnewURL(path);conn(HttpURLConnection)();(true);//設(shè)置是否向httpUrlConnection輸出,post請(qǐng)求,參數(shù)要放在http正文內(nèi)(true);(3000);(3000);(false);(POST);if(()200){Log.d(mylog,getResponseCode:200);return();}}catch(IOExceptione){();}finally{if(conn!null){conn.disconnect();}}returnnull;}publicstaticStringgetResponseBody(Stringpath,Stringparams){HttpURLConnectionconnnull;StringBufferresultnewStringBuffer()

;try{URLurlnewURL(path);conn(HttpURLConnection)();(true);//設(shè)置是否向httpUrlConnection輸出,post請(qǐng)求,參數(shù)要放在http正文內(nèi)(true);(3000);(3000);(false);(POST);//數(shù)據(jù)輸出流,該語(yǔ)句隱含的執(zhí)行connect動(dòng)作if(params!null){DataOutputStreamoutnewDataOutputStream(());//將參數(shù)寫(xiě)入流,刷新提交關(guān)閉流out.writeBytes(params);out.flush();();}//讀取連接返回的數(shù)據(jù)BufferedReaderreadernewBufferedReader(newInputStreamReader(()));StringinputLinenull;while(((inputLine())!null)){(inputLine);//

;}//關(guān)閉();if(()200){Log.d(mylog,getResponseCode:200);}}catch(IOExceptione){();}finally{if(conn!null){conn.disconnect();}}return();}}主activity:[java]viewplaincopyprintpackage;importorg.json.JSONArray;importorg.json.JSONException;importorg.json.JSONObject;import;import;import;importandroid.os.Bundle;importandroid.util.Log;importandroid.util.TypedValue;import;import;import;import;import;import;importandroid.widget.TextView;publicclassHomeWork4extendsActivity{Stringpath此處省略,你要請(qǐng)求的地址;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView();LinearLayoutmainLayout(LinearLayout)findViewById();Stringresult(path,null);//Log.d(mylog,result:result);try{JSonObjectobjnewJSONObject(result);JSonArrayarray(onlineCourses);for(inti0;iarray.length();i){JSonObjectcourse(i);//Log.d(mylog,course:());//添加左邊的layoutLinearLayoutleftlayoutnewlinearLayout(this);//注意包,其它包下面的LayoutParams不起作用LayoutParamsparamsnewLayoutParams(_PARENT,_CONTENT);;(params);(LinearLayout.HORIZONTAL);(_VERTICAL);//添加左邊layout的圖片ImageViewimageViewnewImageView(this);paramsnewLayoutParams(_CONTENT,_CONTENT);(params);(_default_195_130);(imageView);//添加右邊的layout,分為上下2部分,上面是標(biāo)題,下面是進(jìn)度條LinearLayoutrightlayoutnewlinearLayout(this);LayoutParamsrightLayoutParamsnewLayoutParams(_PARENT,_CONTENT);(rightLayoutParams);();//添加課程標(biāo)題TextViewtextViewnewTextView(this);paramsnewLayoutParams(_CONTENT,_CONTENT);(params);((courseName).toString());(_UNIT_SP,15);//18SP//學(xué)分,水平布局,分為左右,左:學(xué)分,,右:分值LinearLayoutstudyLayoutnewlinearLayout(this);paramsnewLayoutParams(_PARENT,_CONTENT);(params);(LinearLayout.HORIZONTAL);//添加學(xué)分TextViewstudyViewnewTextView(this);paramsnewLayoutParams(_CONTENT,_CONTENT);(params);(學(xué)分:);(_UNIT_SP,12);((#b6b6b6));//第2種方法:setTextColor(Color.rgb(255,255,255));//添加學(xué)分值TextViewstudyValueViewnewTextView(this);paramsnewLayoutParams(_CONTENT,_CONTENT);(params);((courseCredit).toString());(_UNIT_SP,14);//進(jìn)度條,水平布局,分為左中右,左:學(xué)習(xí)進(jìn)度,中:進(jìn)度條,右:%值LinearLayoutprocessLayoutnewlinearLayout(this);paramsnewLayoutParams(_PARENT,_CONTENT);(params);(LinearLayout.HORIZONTAL);//添加學(xué)習(xí)進(jìn)度TextViewprocesstextViewnewTextView(this);paramsnewLayoutParams(_CONTENT,_CONTENT);(params);(學(xué)習(xí)進(jìn)度:);(_UNIT_SP,12);((#b6b6b6));//添加進(jìn)度條ProgressBarbarnewProgressBar(this,null,);//指定進(jìn)度條樣式paramsnewLayoutParams(150,_CONTENT);(params);(100);(10);//添加%值TextViewprocessvaluetextViewnewTextView(this);paramsnewLayoutParams(_CONTENT,_CONTENT);(params);(10%);(_UNIT_SP,12);((#b6b6b6));//添加標(biāo)題(textView);//添加學(xué)分(studyView);(studyValueView);(studyLayout);//添加進(jìn)度條(processtextView);(bar);(processvaluetextView);(processLayout);//添加左右邊(rightlayout);(leftlayout);}}catch(JSONExceptione){(); 

dw中spanclass怎么添加?

在標(biāo)簽上添加class屬性或者id屬性,比如啊,

或者

在css文件中id選擇器(唯一不可重復(fù)使用)#red{樣式;}class類(lèi)選擇器.center{樣式;}

 
反對(duì) 0舉報(bào) 0 收藏 0 打賞 0評(píng)論 0
 
更多>同類(lèi)資訊
推薦圖文
推薦資訊
點(diǎn)擊排行
合作伙伴
網(wǎng)站首頁(yè)  |  關(guān)于我們  |  聯(lián)系方式  |  使用協(xié)議  |  版權(quán)隱私  |  網(wǎng)站地圖  |  排名推廣  |  廣告服務(wù)  |  積分換禮  |  網(wǎng)站留言  |  RSS訂閱  |  違規(guī)舉報(bào)  |  冀ICP備2023006999號(hào)-8
 
主站蜘蛛池模板: 国产欧美日韩第一页 | 精品国产乱码久久久久久一区二区 | 成人欧美一区二区三区在线 | 成人精品视频在线观看播放 | 国产欧美一区二区三区精品 | 欧洲第一页 | 欧美日韩免费一区二区在线观看 | 午夜日本一区二区三区 | 久久久国产成人精品 | 日韩欧美高清 | 国产人澡人澡澡澡人碰视频 | 亚洲欧洲高清有无 | 免费在线观看的视频 | 在线观看视频日韩 | 大色欧美 | 国产日韩一区二区三区在线播放 | 一级毛片成人免费看a | 欧美日韩亚洲电影天堂 | 国产精品成人久久久 | 国产91精品久久久久999 | 在线播放真实国产乱子伦 | 免费国产一级 | 亚洲成人99 | 亚洲色图欧美另类 | 亚洲 欧美 自拍 另类 | 在线欧美日韩 | 极品国产高颜值露脸在线 | 最新欧美日韩 | 综合视频在线 | 亚洲一区二区三区高清 | 日韩v欧美| 亚洲欧美国产另类 | 欧美在线视频网站 | 欧美视频区 | 欧美亚洲综合网 | www.a级片| 欧美日韩中 | 免费国产在线观看 | 国产美女精品久久久久中文 | 国产91在线 | 日本 | 高清一区二区亚洲欧美日韩 |