国产成人毛片视频|星空传媒久草视频|欧美激情草久视频|久久久久女女|久操超碰在线播放|亚洲强奸一区二区|五月天丁香社区在线|色婷婷成人丁香网|午夜欧美6666|纯肉无码91视频

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

在android開(kāi)發(fā)中,怎樣動(dòng)態(tài)生成多界面?效果:layout界面布局:[html] view plaincopyprintxml version1.0 encodingutf-8LinearLayo

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

效果:layout界面布局:[html] view plaincopyprintxml version1.0 encodingutf-8LinearLayout xmlns:ad_widthmatch_parentad:layout_heightmatch_parentad:orientationvertical LinearLayoutad:layout_widthmatch_parentad:layout_height30dpad:/titlebar_bgad:orientationhorizontal ImageViewad:layout_widthwrap_contentad:layout_heightwrap_contentad:/back_44_44 /LinearLayoutad:layout_widthmatch_parentad:layout_height30dpad:gravitycenter TextViewad:layout_widthwrap_contentad:layout_heightwrap_contentad:text課程列表ad:textSize20sp //LinearLayout/LinearLayoutScrollViewad:id@ id/ScrollViewad:layout_widthfill_parentad:layout_heightwrap_contentad:scrollbarsvertical LinearLayoutad:id@ id/mainLayoutad:layout_widthmatch_parentad:layout_heightwrap_contentad:orientationvertical /LinearLayout/ScrollView/LinearLayouthttputil輔助類(lèi):

[java] view plaincopyprintpackage ;import ;import ;import ;import ;import ;import ;import ;import android.util.Log;public class HttpUtil {/*** 獲取到流,自己處理數(shù)據(jù)* @param path* @return*/public static InputStream getInputStream(String path) {HttpURLConnection conn null;try {URL url new URL(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 (IOException e) {();} finally {if (conn ! null) {conn.disconnect();}}return null;}/*** 直接返回響應(yīng)體正文* @param path* @return*/public static String getResponseBody(String path,String params) {HttpURLConnection conn null;StringBuffer resultnew StringBuffer()

;try {URL url new URL(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){DataOutputStream out new DataOutputStream( ());//將參數(shù)寫(xiě)入流,刷新提交關(guān)閉流out.writeBytes(params);out.flush();();}//讀取連接返回的數(shù)據(jù)BufferedReader reader new BufferedReader(new InputStreamReader( ()));String inputLine null;while (((inputLine ()) ! null)) {(inputLine);//

;}//關(guān)閉();if (() 200) {Log.d(mylog, getResponseCode: 200);}} catch (IOException e) {();} finally {if (conn ! null) {conn.disconnect();}}return ();}}主activity:[java] view plaincopyprintpackage ;import org.json.JSONArray;import org.json.JSONException;import org.json.JSONObject;import ;import ;import ;import android.os.Bundle;import android.util.Log;import android.util.TypedValue;import ;import ;import ;import ;import ;import ;import android.widget.TextView;public class HomeWork4 extends Activity {String path 此處省略,你要請(qǐng)求的地址;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView();LinearLayout mainLayout (LinearLayout)findViewById();String result(path,null);// Log.d(mylog, result: result);try{JSONObject obj new JSONObject(result);JSONArray array(onlineCourses);for (int i 0; i array.length(); i ) {JSONObject course (i);// Log.d(mylog, course: ());//添加左邊的layoutLinearLayout leftlayoutnew LinearLayout(this);//注意包,其它包下面的LayoutParams不起作用LayoutParams paramsnew LayoutParams(_PARENT, _CONTENT);;(params);(LinearLayout.HORIZONTAL);(_VERTICAL);//添加左邊layout的圖片ImageView imageViewnew ImageView(this);paramsnew LayoutParams(_CONTENT, _CONTENT);(params);(_default_195_130);(imageView);//添加右邊的layout,分為上下2部分,上面是標(biāo)題,下面是進(jìn)度條LinearLayout rightlayoutnew LinearLayout(this);LayoutParams rightLayoutParamsnew LayoutParams(_PARENT, _CONTENT);(rightLayoutParams);();//添加課程標(biāo)題TextView textViewnew TextView(this);paramsnew LayoutParams(_CONTENT, _CONTENT);(params);((courseName).toString());(_UNIT_SP, 15);//18SP//學(xué)分,水平布局,分為左右,左:學(xué)分,,右:分值LinearLayout studyLayoutnew LinearLayout(this);paramsnew LayoutParams(_PARENT, _CONTENT);(params);(LinearLayout.HORIZONTAL);//添加學(xué)分TextView studyViewnew TextView(this);paramsnew LayoutParams(_CONTENT, _CONTENT);(params);(學(xué)分:);(_UNIT_SP, 12);((#b6b6b6));//第2種方法:setTextColor(Color.rgb(255, 255, 255));//添加學(xué)分值TextView studyValueViewnew TextView(this);paramsnew LayoutParams(_CONTENT, _CONTENT);(params);((courseCredit).toString());(_UNIT_SP, 14);//進(jìn)度條,水平布局,分為左中右,左:學(xué)習(xí)進(jìn)度,中:進(jìn)度條,右:%值LinearLayout processLayoutnew LinearLayout(this);paramsnew LayoutParams(_PARENT, _CONTENT);(params);(LinearLayout.HORIZONTAL);//添加學(xué)習(xí)進(jìn)度TextView processtextViewnew TextView(this);paramsnew LayoutParams(_CONTENT, _CONTENT);(params);(學(xué)習(xí)進(jìn)度:);(_UNIT_SP, 12);((#b6b6b6));//添加進(jìn)度條ProgressBar barnew ProgressBar(this,null,);//指定進(jìn)度條樣式paramsnew LayoutParams(150, _CONTENT);(params);(100);(10);//添加%值TextView processvaluetextViewnew TextView(this);paramsnew LayoutParams(_CONTENT, _CONTENT);(params);(10%);(_UNIT_SP, 12);((#b6b6b6));//添加標(biāo)題(textView);//添加學(xué)分(studyView);(studyValueView);(studyLayout);//添加進(jìn)度條(processtextView);(bar);(processvaluetextView);(processLayout);//添加左右邊(rightlayout);(leftlayout);}}catch(JSONException e){(); 

dw中span class怎么添加?

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

或者

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