欧美色视频免费_2018亚洲男人天堂_好骚综合在线_久久久久久久久国产_日韩精品久久久久久久九岛_国产成年人视频

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

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

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

在android開發(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輔助類:

[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ù)寫入流,刷新提交關(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類選擇器.center{樣式;}

 
反對(duì) 0舉報(bào) 0 收藏 0 打賞 0評(píng)論 0
 
更多>同類資訊
推薦圖文
推薦資訊
點(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
 
主站蜘蛛池模板: 一区二区三区久久久 | 91精品国产91久久久久久最新 | 韩日精品一区 | 天堂男人网 | 免费视频在线观看网站 | 91精品国产综合久久国产大片 | 成人激情视频 | 久久人久久 | 久久久综合久久 | 婷婷综合一区 | 久久久久久亚洲 | 福利片网站 | 亚洲成人精品一区 | 国内精品国产成人国产三级粉色 | 日本黄在线观看 | 成人久久久 | 麻豆视频在线 | 中国av片| 久久久成人网 | 精品久久久久久久久久久久久久久久久 | 99国产精品久久久久久久久久 | 精品久久久久久久久久 | 视频三区| 成人av免费网址 | 欧美一级片在线看 | 中文字幕av网站 | 人人九九精品 | 国产精品久久久久国产a级 在线观看av网站 | 成人精品一区二区三区校园激情 | 天堂在线看 | 国产美女一区二区三区 | 国产在线精品一区 | 九九九九精品九九九九 | 欧美成人精品一区二区三区在线看 | 精品国产乱码久久久久久88av | 日韩免费电影 | 国产精品一区三区 | 久久九九99 | 亚洲国产欧美在线 | 欧美日韩国产一区二区三区 | 91啪国产在线 |