android shape.xml 屬性詳解

轉載源:http://blog.csdn.net/harvic880925/article/details/41850723

一、簡單使用

剛開始,就先不講一堆標簽的意義及用法,先簡單看看shape標簽怎么用。

1、新建shape文件

首先在res/drawable文件夾下,新建一個文件,命名為:shape_radius.xml

內容是這樣的:(先不需要理解,先看shape怎么用)

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<corners?android:radius="20dip"/>??
  4. ????<solid?android:color="#ff00ff"/>??
  5. ??
  6. </shape>??

2、添加到控件中

在定義好shape文件后,下一步就是將其添加到控件中,添加到控件中,一般是使用設置background屬性,將其為控件背景,下面,我們將其設置為MainActivity對應的布局中(activity_main.xml),將其設為TextView的背景,看顯示出來 是什么樣子的。

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <RelativeLayout?xmlns:android="http://schemas.android.com/apk/res/android"??
  2. ????xmlns:tools="http://schemas.android.com/tools"??
  3. ????android:layout_width="match_parent"??
  4. ????android:layout_height="match_parent"??
  5. ????tools:context="com.harvic.tryshape.MainActivity"?>??
  6. ??
  7. ????<TextView??
  8. ????????android:layout_width="wrap_content"??
  9. ????????android:layout_height="wrap_content"??
  10. ????????android:layout_margin="50dip"??
  11. ????????android:text="@string/hello_world"???
  12. ????????android:background="@drawable/shape_radius"/>??
  13. ??????
  14. </RelativeLayout>??

顯示出來的結果是這樣的:



二、基本屬性(corners、gradient、padding、size、solid、stroke)

上面給大家簡單的講了下shape標簽組的簡單使用方法,下面就具體講講shape標簽里所具有的幾個子標簽及所具有的屬性。

1、Corners

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <corners????//定義圓角????
  2. ????android:radius="dimension"??????//全部的圓角半徑????
  3. ????android:topLeftRadius="dimension"???//左上角的圓角半徑????
  4. ????android:topRightRadius="dimension"??//右上角的圓角半徑????
  5. ????android:bottomLeftRadius="dimension"????//左下角的圓角半徑????
  6. ????android:bottomRightRadius="dimension"?/>????//右下角的圓角半徑????

Corners標簽是用來字義圓角的,其中radius與其它四個并不能共同使用。

Android:radius:定義四個角的的圓角半徑。

其它四個是逐個字義每個角的圓角半徑。

使用:

控件布局:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <RelativeLayout?xmlns:android="http://schemas.android.com/apk/res/android"??
  2. ????android:layout_width="match_parent"??
  3. ????android:layout_height="match_parent"?>??
  4. ??
  5. ????<TextView??
  6. ????????android:layout_width="100dp"??
  7. ????????android:layout_height="100dp"??
  8. ????????android:layout_margin="50dip"??
  9. ????????android:text="@string/hello_world"???
  10. ????????android:background="@drawable/shape_radius"/>??
  11. ?</RelativeLayout>??

shape定義:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<corners?android:radius="20dip"/>??
  4. ????<solid?android:color="#ffff00"/>??
  5. </shape>??

效果:



2、solid

solid用以指定內部填充色

只有一個屬性:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <solid??android:color="color"?/>????

在上面的例子中,我們就將填充色指定為#ffff00了,如果我們不加圓角,只使用填充色,即將shape變成這樣子:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<solid?android:color="#ffff00"/>??
  4. </shape>??

那效果就是這樣的:



3、gradient

gradient用以定義漸變色,可以定義兩色漸變和三色漸變,及漸變樣式,它的屬性有下面幾個:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <gradient???
  2. ????android:type=["linear"?|?"radial"?|?"sweep"]????//共有3中漸變類型,線性漸變(默認)/放射漸變/掃描式漸變????
  3. ????android:angle="integer"?????//漸變角度,必須為45的倍數,0為從左到右,90為從上到下????
  4. ????android:centerX="float"?????//漸變中心X的相當位置,范圍為0~1????
  5. ????android:centerY="float"?????//漸變中心Y的相當位置,范圍為0~1????
  6. ????android:startColor="color"???//漸變開始點的顏色????
  7. ????android:centerColor="color"??//漸變中間點的顏色,在開始與結束點之間????
  8. ????android:endColor="color"????//漸變結束點的顏色????
  9. ????android:gradientRadius="float"??//漸變的半徑,只有當漸變類型為radial時才能使用????
  10. ????android:useLevel=["true"?|?"false"]?/>??//使用LevelListDrawable時就要設置為true。設為false時才有漸變效果????

首先有三種漸變類型,分別是:linear(線性漸變)、radial(放射性漸變)、sweep(掃描式漸變)

(1)先看看這幾個屬性的使用方法:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. android:type=["linear"?|?"radial"?|?"sweep"]??
  2. android:startColor="color"???//漸變開始點的顏色????
  3. android:centerColor="color"??//漸變中間點的顏色,在開始與結束點之間????
  4. android:endColor="color"????//漸變結束點的顏色????
  5. android:gradientRadius="float"??//漸變的半徑,只有當漸變類型為radial時才能使用????

下面我們使用三色漸變來看看這三種漸變方式都是怎么顯示的:(如果不使用centerColor屬性就是雙色漸變,這個屬性是可選的)


需要注意的一點是,在構造放射性漸變時,要加上android:gradientRadius屬性(漸變半徑),即必須指定漸變半徑的大小才會起作用,下面列出這三個漸變方式的shape代碼,供大家參考:

線性漸變:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<gradient???
  4. ????????android:type="linear"??
  5. ????????android:startColor="#ff0000"??
  6. ????????android:centerColor="#00ff00"??
  7. ????????android:endColor="#0000ff"/>??
  8. </shape>??

放射性漸變:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<gradient???
  4. ????????android:type="radial"??
  5. ????????android:startColor="#ff0000"??
  6. ????????android:centerColor="#00ff00"??
  7. ????????android:endColor="#0000ff"??
  8. ????????android:gradientRadius="100"/>??
  9. </shape>??

掃描式漸變:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<gradient???
  4. ????????android:type="sweep"??
  5. ????????android:startColor="#ff0000"??
  6. ????????android:centerColor="#00ff00"??
  7. ????????android:endColor="#0000ff"/>??
  8. </shape>??

可見放射性漸變,只是比其它兩個多了個android:gradientRadius屬性

(2)、android:angle屬性(僅對線性漸變有效)

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. android:angle="integer"?????//漸變角度,必須為45的倍數,0為從左到右,90為從上到下????

我們在上面的三種漸變上都加上angle屬性,看看效果如何:


能過跟上一個圖對比可以發現,angle屬性確實只對線性漸變有效,其它兩種漸變方式都沒有任何動靜,下面是此時的線性漸變shape代碼:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<gradient???
  4. ????????android:type="linear"??
  5. ????????android:startColor="#ff0000"??
  6. ????????android:centerColor="#00ff00"??
  7. ????????android:endColor="#0000ff"??
  8. ????????android:angle="45"/>??
  9. </shape>??

(3)、android:centerX與android:centerY

centerX、centerY兩個屬性用于設置漸變的中心點位置,僅當漸變類型為放射漸變時有效,類型為分數或小數,不接受Dimension。默認值是0.5,有效值是0.0~1.0,超出該范圍后會看不出漸變效果。centerX、centerY的取值其實是寬和高的百分比;不難理解,下面看代碼:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<gradient???
  4. ????????android:type="sweep"??
  5. ????????android:startColor="#ff0000"??
  6. ????????android:centerColor="#00ff00"??
  7. ????????android:endColor="#0000ff"??
  8. ????????android:centerX="0.2"??
  9. ????????android:centerY="0.8"/>??
  10. </shape>??

取寬度的20%和高度的80%的位置,作為新的漸變原點,效果是這樣的:


(4)android:useLevel

useLevel屬性通常不使用。該屬性用于指定是否將該shape當成一個LevelListDrawable來使用,默認值為false。

4、stroke

這是描邊屬性,可以定義描邊的寬度,顏色,虛實線等

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <stroke?????????
  2. ????android:width="dimension"???//描邊的寬度????
  3. ????android:color="color"???//描邊的顏色????
  4. ????//?以下兩個屬性設置虛線????
  5. ????android:dashWidth="dimension"???//虛線的寬度,值為0時是實線????
  6. ????android:dashGap="dimension"?/>??????//虛線的間隔???

上面各個屬性的意義如下:

我們使用綠色虛線描邊,虛線高度是20dp,虛線寬度為10dp虛線間距為1dp:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"?>??
  3. ????<stroke???
  4. ????????android:width="20dp"???
  5. ????????android:color="#00ff00"??
  6. ????????android:dashWidth="10dp"??
  7. ????????android:dashGap="1dp"?/>??
  8. </shape>??

從效果圖中,我們也能清晰的看出這三個參數(width、dashwidth、dashGap)之間的區別:

5、size和padding

這兩個基本上不怎么用,因為他們所具有的功能,控件本身也能實現。
size:是用來定義圖形的大小的。

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <size????
  2. ????android:width="dimension"????
  3. ????android:height="dimension"?/>??

padding:用來定義內部邊距

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <padding?????
  2. ????android:left="dimension"????
  3. ????android:top="dimension"????
  4. ????android:right="dimension"????
  5. ????android:bottom="dimension"?/>??

?

三、Shape的屬性(rectangle、oval、line、ring)

上面我們講了Shape的子標簽的的作用,但Shape本身還沒講,Shape自已是可以定義當前Shape的形狀的,比如上面的矩形,還有橢圓形,線形和環形;這些都是通過Shape標簽的 shape屬性來定義的,Shape標簽總共有下面幾個屬性,我們一個個講:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. android:shape=["rectangle"?|?"oval"?|?"line"?|?"ring"]????
  2. shape的形狀,默認為矩形,可以設置為矩形(rectangle)、橢圓形(oval)、線性形狀(line)、環形(ring)????
  3. 下面的屬性只有在android:shape="ring時可用:????
  4. android:innerRadius?????????尺寸,內環的半徑。????
  5. android:innerRadiusRatio????浮點型,以環的寬度比率來表示內環的半徑,????
  6. android:thickness???????????尺寸,環的厚度????
  7. android:thicknessRatio??????浮點型,以環的寬度比率來表示環的厚度,例如,如果android:thicknessRatio="2",????
  8. android:useLevel????????????boolean值,如果當做是LevelListDrawable使用時值為true,否則為false.???

可見,只有第一個shape是可用的,其它五個都是shape等于ring時所特有的。

注意,無論這里shape取什么形狀,他的子標簽都是可用的,但有時并不會有效果,比如在shape為橢圓時,那corners標簽就不會有效果,很顯然的道理。下面一個個看看各個形狀都是怎么樣的;

1、rectangle (矩形)

這就是上一節我們使用的形狀,當我們不指定shape屬性時,默認就是矩形的。?

控件代碼:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <LinearLayout?xmlns:android="http://schemas.android.com/apk/res/android"??
  2. ????android:layout_width="match_parent"??
  3. ????android:layout_height="match_parent"??
  4. ????android:orientation="horizontal"?>??????
  5. ????<TextView??
  6. ????????android:layout_width="300dp"??
  7. ????????android:layout_height="100dp"??
  8. ????????android:layout_margin="10dp"??
  9. ????????android:textColor="#ffffff"??
  10. ????????android:textSize="18sp"??
  11. ????????android:textStyle="bold"??
  12. ????????android:background="@drawable/try_shape_3"/>??
  13. ?</LinearLayout>??

shape代碼:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"???
  3. ????android:shape="rectangle">??
  4. ????<solid?android:color="#ff00ff"/>??
  5. </shape>??

對應圖形:

2、oval(橢圓)

控件代碼不變,下面是shape代碼:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"???
  3. ????android:shape="oval">??
  4. ????<solid?android:color="#ff00ff"/>??
  5. </shape>??

對應圖形:(控件大小的矩形所對應的橢圓)


3、line(線形)

沒覺得這個能有什么用……,也不講了,沒什么意思

4、ring(環形)

還記得他所特有的幾個屬性么:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. android:innerRadius?????????尺寸,內環的半徑。????
  2. android:thickness???????????尺寸,環的厚度????
  3. android:innerRadiusRatio????浮點型,以環的寬度比率來表示內環的半徑,????
  4. ??????例如,如果android:innerRadiusRatio,表示內環半徑等于環的寬度除以5,這個值是可以被覆蓋的,默認為9.????
  5. android:thicknessRatio??????浮點型,以環的寬度比率來表示環的厚度,例如,如果android:thicknessRatio="2",????
  6. ??????那么環的厚度就等于環的寬度除以2。這個值是可以被android:thickness覆蓋的,默認值是3.????
  7. android:useLevel????????????boolean值,如果當做是LevelListDrawable使用時值為true,否則為false.??

這么幾個屬性無外乎就是定義環形的內環尺寸和環的寬度。

舉個例子:

控件定義:

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <LinearLayout?xmlns:android="http://schemas.android.com/apk/res/android"??
  2. ????android:layout_width="match_parent"??
  3. ????android:layout_height="match_parent"??
  4. ????android:orientation="horizontal"?>??????
  5. ????<TextView??
  6. ????????android:layout_width="300dp"??
  7. ????????android:layout_height="100dp"??
  8. ????????android:layout_margin="10dp"??
  9. ????????android:textColor="#ffffff"??
  10. ????????android:textSize="18sp"??
  11. ????????android:textStyle="bold"??
  12. ????????android:background="@drawable/try_shape_2"/>??
  13. ?</LinearLayout>??

shape定義:(這里一定要要加上useLevel屬性并定義為false,不然沒有效果)

[html] view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <shape?xmlns:android="http://schemas.android.com/apk/res/android"???
  3. ????android:shape="ring"???
  4. ????android:innerRadius="20dp"???
  5. ????android:thickness="50dp"????
  6. ????android:useLevel="false">??
  7. ??????
  8. ????<solid?android:color="#ff00ff"/>??
  9. ??????
  10. </shape>??

效果圖:



源碼地址:http://download.csdn.net/detail/harvic880925/8249629
請大家尊重原創者版權,轉載請標時出處:http://blog.csdn.net/harvic880925/article/details/41850723?謝謝。

轉載于:https://www.cnblogs.com/imqsl/p/6561173.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/541737.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/541737.shtml
英文地址,請注明出處:http://en.pswp.cn/news/541737.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

linux檢查防火墻是否阻擋端口,淺析linux查看防火墻狀態和對外開放的端口狀態...

1.查看防火墻狀態查看防火墻狀態 systemctl status firewalld開啟防火墻 systemctl start firewalld關閉防火墻 systemctl stop firewalld開啟防火墻 service firewalld start若遇到無法開啟先用&#xff1a;systemctl unmask firewalld.service然后&#xff1a;systemctl star…

Java類class getClasses()方法及示例

類的類getClasses()方法 (Class class getClasses() method) getClasses() method is available in java.lang package. getClasses()方法在java.lang包中可用。 getClasses() method is used to return an array that contains Class objects denoting all the public classes…

linux內核計數函數,linux中的內核引用計數器

linux中的內核引用計數器文檔 /Documentation/kref.txt翻譯。krefs能讓你往你的對象中添加一個引用計數器。如果你有一些需要在多處被使用和傳遞的對象&#xff0c;而你并沒有給這些對象中添加引用計數器的話&#xff0c;你的代碼肯定會有某些缺陷&#xff0c;會出現一些問題。…

jQuery常用的全局方法源碼

下面常用方法的詳細使用請查看&#xff1a;http://www.cnblogs.com/moqiutao/p/4775725.html 1.$.noConflict()方法 語法&#xff1a;jQuery.noConflict(removeAll) removeAll&#xff1a;布爾值。指示是否允許徹底將 jQuery 變量還原。 源碼&#xff1a; var// Map over jQuer…

isinstance_Java類class isInstance()方法及示例

isinstance類class isInstance()方法 (Class class isInstance() method) isInstance() method is available in java.lang package. isInstance()方法在java.lang包中可用。 isInstance() method is used to check whether the given object is an instance with the object d…

Linux比較大文件內容,Linux系統最大文件打開數優化,解決Too many open files報錯

這是一個Linux系統常見的故障&#xff0c;網絡上也能輕易的找到解決辦法&#xff0c;我也只是在工作中遇到了這個問題&#xff0c;所以在博客記錄下&#xff0c;以備不時之需。一、報錯截圖&#xff1a;圖為resin的報錯日志&#xff0c;很明顯提示了Too many open files&#x…

java日歷類add方法_Java日歷computeFields()方法及示例

java日歷類add方法日歷類的computeFields()方法 (Calendar Class computeFields() method) computeFields() method is available in java.util package. 在java.util包中提供了validateFields()方法 。 computeFields() method is used to convert current ms(milliseconds) t…

Varnish緩存代理簡介與配置

一、varnish原理&#xff1a;1&#xff09;Varnish簡介&#xff1a;varnish緩存是web應用加速器&#xff0c;同時也作為http反向緩存代理。你可以安裝varnish在任何http的前端&#xff0c;同時配置它緩存內容。與傳統的 squid 相比&#xff0c;varnish 具有性能更高、速度更快、…

Linux允許61440端口,釋放對某端口的占用

釋放對某端口的占用假如我們需要確定誰占用了我們的9050端口在windows命令行窗口下執行&#xff1a;1.查看所有的端口占用情況C:\>netstat -ano協議 本地地址 外部地址 狀態 PIDTCP 127.0.0.1:1434 0.0.…

as_hash ruby_Hash.merge(other_hash)方法與Ruby中的示例

as_hash rubyHash.merge(other_hash)方法 (Hash.merge(other_hash) Method) In this article, we will study about Hash.merge(other_hash) Method. The working of the method can’t be assumed because it’s quite a different name. Let us read its definition and unde…

linux 安裝nfs 客戶端,在CentOS 7上安裝NFS服務器和客戶端

NFS服務器和客戶端安裝在CentOS 7上版本1.0作者&#xff1a;Srijan Kishore 在Twitter上關注howtoing最后編輯 16 / Dec / 2014本指南介紹如何在CentOS 7.0中配置NFS服務器網絡文件系統(NFS)是一種流行的分布式文件系統協議&#xff0c;可讓用戶在其服務器上安裝遠程目錄。 該系…

安裝ORACLE 時報錯 /jre/1.4.2/lib/i386/libawt.so:

最近在linux下安裝oracle 10g時&#xff0c;碰到如下問題&#xff1a; /tmp/OraInstall2011-09-11_02-16-11PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred.. 網上找了下&#xff0c;真讓人費解呀&am…

Java線程start()vs run()方法及示例

Java | 線程start()vs run()方法 (Java | Thread start() vs run() Methods) When we call the start() method, it leads to the creation of a new thread. Then, it automatically calls the run() method. If we directly call the run() method, then no new thread will …

linux安裝卸載mysql,Linux6 系列 安裝、卸載mysql

Linux6 系列 安裝、卸載mysqlLinux6 系列 安裝、卸載mysqlLinux環境下載mysql&#xff1a;https://blog.csdn.net/weixin_40816738/article/details/90111456一、安裝環境依賴&#xff1a;yum install -y cmake make gcc gcc-c libaio ncurses ncurses-devel二、安裝流程1、軟件…

Python | 如何使用pip升級所有Python軟件包?

While using Python as a programming language, its a very common scenario to use a virtual environment and PIP, a package manager for python. 當使用Python作為編程語言時&#xff0c;使用虛擬環境和PIP (Python的程序包管理器)是一種非常常見的情況。 Its a common …

linux下enum類型占幾個字節,enum大小問題

問題描述板卡有兩個CPU&#xff0c;ARMMIPS&#xff0c;同時運行三個系統REE(linux) TEE(SierraTEE) SEE(TDS)。TEE跟SEE通過RPC進行通信&#xff0c;有enum成員的結構體信息傳遞會出錯&#xff0c;如下結構體&#xff1a;struct sTag {enum A;enum B;int C;enum D;};問題分析…

ASP.NET導出word實例

ASP.NET導出word實例 最近遇到一個題目就是如何在asp.net中將數據導出到word中&#xff0c;由于數據是動態的&#xff0c;所以需要在后臺拼出想要的的格式&#xff0c;翻遍了網頁找出了一個比較滿意的代碼&#xff0c;感謝那位高手。代碼如下&#xff1a; public void Download…

Java LocalDate類| toString()方法與示例

LocalDate類toString()方法 (LocalDate Class toString() method) toString() method is available in java.time package. toString()方法在java.time包中可用。 toString() method is used to represent this LocalDate as a String by using the standards ISO-8601 format.…

linux14.04 Apache,Ubuntu 14.04編譯安裝Apache

Ubuntu下編譯安裝apache需要預先編譯安裝多個依賴件&#xff0c;包括&#xff1a;apr, apr-util,pcre,zlib-devel&#xff0c;等&#xff0c;相當麻煩&#xff0c;記錄于此備查.由于Ubuntu系統默認安裝時沒有安裝C&#xff0c;所以也需要先安裝c編譯需要相關的組件。[注]apt-ca…

Android Jenkins自動化構建之路

install Jenkins 添加Jenkins的源&#xff08;repository&#xff09;: sudo wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key復制代碼yum install Jenkins復制代碼…