最近都没写波可,因为在疯狂得赶项目,其中有一天疯狂得写了16个小时,真得写到了手发软,脚无力,脑袋变白痴得状态,好在终于阶段性小结了一下,希望以后能不那么赶,可以有更多时间研究各种有意思得技术。
发一篇关于android设置文本透明度得例子。
package com.google.android.alphaTest;
import android.widget.TextView;
import android.os.Bundle;
import android.view.ViewGroup;
import android.app.Activity;
import android.graphics.Color;
import android.widget.LinearLayout;
/*本教程版权为http://yuefeng.iteye.com/ 博客主人所有,代码随意使用,如想转载请表明出处,这是对写教程人得起码尊重,谢谢:)
*/
public class alphaTest extends Activity {
final int WRAP_CONTENT = ViewGroup.LayoutParams.WRAP_CONTENT;
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setOrientation(LinearLayout.VERTICAL);
setContentView(linearLayout);
TextView TV1 = new TextView(this);
TV1.setText("全部不透明=255");
TV1.setBackgroundColor(Color.argb(255, 0, 255, 0));
linearLayout.addView(TV1, new LinearLayout.LayoutParams(WRAP_CONTENT,
WRAP_CONTENT));
TextView TV2 = new TextView(this);
TV2.setText("部分透明=155");
TV2.setBackgroundColor(Color.argb(155, 0, 255, 0));
linearLayout.addView(TV2, new LinearLayout.LayoutParams(WRAP_CONTENT,
WRAP_CONTENT));
TextView TV3 = new TextView(this);
TV3.setText("部分透明=55");
TV3.setBackgroundColor(Color.argb(55, 0, 255, 0));
linearLayout.addView(TV3, new LinearLayout.LayoutParams(WRAP_CONTENT,
WRAP_CONTENT));
TextView TV4 = new TextView(this);
TV4.setText("全部透明=0");
TV4.setBackgroundColor(Color.argb(0, 0, 255, 0));
linearLayout.addView(TV4, new LinearLayout.LayoutParams(WRAP_CONTENT,
WRAP_CONTENT));
}
}
分享到:
相关推荐
android-support-v4-v7-v13-v14-v17(官方最新完整版),官方最新版的,压缩包内包含android-support-v4、android-support-v7-appcompat,android-support-v7-cardview,android-support-v7-gridlayout,android-support-...
LCardView - 卡片布局,可设置阴影颜色,透明度,圆角大小,阴影宽度
android-sdk\platforms\android-21
将android-17.zip解压到 Android\android-sdk\platforms 文件夹下。
http://s1.eoeandroid.com/sdk/4.1/android-sdk_r20-windows.zip(推荐) http://s1.eoeandroid.com/sdk/4.1/installer_r20-windows.exe Mac版: http://s1.eoeandroid.com/sdk/4.1/android-sdk_r20-macosx.zip ...
android-sdk\platforms\android-20
asmack-android-8-4.0.7jar 2015-02-20更新,现在asmack已经托管到github上,费了很长时间才找到,在这里分享给大家
ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar 要是需要最新的,下载地址: http://code.google.com/p/ksoap2-android/
最新android studio 2015/10/12日更新 2015/10/12 android-studio-bundle-141.2288178-windows
一个基于Android原生的EditText的富文本组件,支持文字输入,可以插入图片
android-support-multidex解决Android Dex 65536 65k问题,解决方案来自严振杰的博客:http://blog.csdn.net/yanzhenjie1003/article/details/51818269
将android-18解压到Android\android-sdk\platforms下。
这是最新版的android-support-v4.jar,大小1MB多,比其它那种几百K的要大,因为这是最新的android-support-v4.jar,有最新的android.support.v4.view.animation类,现在是2015年10月,这是截至目前最新的jar包
android-support-v13.jar android-support-v7-gridlayout.jar android-support-v7-appcompat.jar android-support-v4.jar
Android-Studio使用教程
android-sdk_r21-windows.zip
最新android-19资源包,免费下载
android-ndk-r16b-windows-x86_64包里toolchains目录下的mips64el-linux-android-4.9和mipsel-linux-android-4.9,可以解决NDK17版本以上编译出现的No toolchains found in the NDK