当前位置: 编程技术>移动开发
本页文章导读:
▪Starling-Feathers中设立单个组件对象的样式 Starling-Feathers中设置单个组件对象的样式
关于基于Starling的Feathers组件库,版本号比较小,是个比较新的东西,所以,可能并不是太完善,并且API文档中介绍的其实并不够详细在使用例如But.........
▪ 检测资料是否存在 检测文件是否存在
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:somePath];
......
▪ Pract04 Intent的应用于多个Activity的交互(二) Pract04 Intent的应用于多个Activity的交互(2)实机测试界面截图如下:
AndroidManifest.xm
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="folyd.pr.........
[1]Starling-Feathers中设立单个组件对象的样式
来源: 互联网 发布时间: 2014-02-18
Starling-Feathers中设置单个组件对象的样式
关于基于Starling的Feathers组件库,版本号比较小,是个比较新的东西,所以,可能并不是太完善,并且API文档中介绍的其实并不够详细
在使用例如Button的selectedDownSkin
或者其他组件的****Skin来设置组件的某种状态样式
API文档中介绍了,set方法的参数是一个DisplayObject,再就没有更详细的了,而Texture并不是基于DisplayObject的,所以,不能直接用Texture
好在还有Starling官方的Wiki来说明这些
http://wiki.starling-framework.org/feathers/button?s[]=skin
这里面可以使用new Image()来实现
还有一种方法就是类似于写样式类一样的去实现,不过写起来就繁琐不少了
要写样式的初始化方法,写样式的对应值和状态选择器等
参考:http://wiki.starling-framework.org/feathers/extending-themes
关于基于Starling的Feathers组件库,版本号比较小,是个比较新的东西,所以,可能并不是太完善,并且API文档中介绍的其实并不够详细
在使用例如Button的selectedDownSkin
或者其他组件的****Skin来设置组件的某种状态样式
API文档中介绍了,set方法的参数是一个DisplayObject,再就没有更详细的了,而Texture并不是基于DisplayObject的,所以,不能直接用Texture
好在还有Starling官方的Wiki来说明这些
http://wiki.starling-framework.org/feathers/button?s[]=skin
这里面可以使用new Image()来实现
还有一种方法就是类似于写样式类一样的去实现,不过写起来就繁琐不少了
要写样式的初始化方法,写样式的对应值和状态选择器等
参考:http://wiki.starling-framework.org/feathers/extending-themes
[2] 检测资料是否存在
来源: 互联网 发布时间: 2014-02-18
检测文件是否存在
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:somePath];
[3] Pract04 Intent的应用于多个Activity的交互(二)
来源: 互联网 发布时间: 2014-02-18
Pract04 Intent的应用于多个Activity的交互(2)
实机测试界面截图如下:
AndroidManifest.xm
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="folyd.pract04" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="folyd.pract04.MainAct" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="folyd.pract04.OtherAct" android:label="@string/result"></activity> </application> </manifest>
MainAct.java
package folyd.pract04; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MainAct extends Activity { private EditText ed1=null,ed2=null; private TextView tv=null; private Button btn=null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ed1=(EditText)findViewById(R.id.et_id1); ed2=(EditText)findViewById(R.id.et_id2); tv=(TextView)findViewById(R.id.tv_id); btn=(Button)findViewById(R.id.btn_id); tv.setText(R.string.mulit); btn.setText(R.string.cal); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String str1=ed1.getText().toString(); String str2=ed2.getText().toString(); Intent intent=new Intent(); intent.putExtra("one", str1); intent.putExtra("two", str2); intent.setClass(MainAct.this, OtherAct.class); MainAct.this.startActivity(intent); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } }
OtherAct.java
package folyd.pract04; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; public class OtherAct extends Activity{ private TextView result_tv=null; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.other); result_tv=(TextView)findViewById(R.id.reslut_id); //result_tv.setText("Result"); Intent intent=getIntent();//getIntent()是Activity的方法 int fact1=Integer.parseInt(intent.getStringExtra("one")); int fact2=Integer.parseInt(intent.getStringExtra("two")); int resultInt=fact1*fact2; result_tv.setText(resultInt+"");//setText()方法是TextView的 } }
main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <EditText android:id="@+id/et_id1" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tv_id" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <EditText android:id="@+id/et_id2" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <Button android:id="@+id/btn_id" android:background="#00ff00" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout>
other.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/reslut_id" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </LinearLayout>
string.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Pract04</string> <string name="cal">计算</string> <string name="result">Result</string> <string name="mulit">乘以</string> <string name="menu_settings">Settings</string> </resources>
R.java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package folyd.pract04; public final class R { public static final class attr { } public static final class drawable { public static final int ic_launcher=0x7f020000; } public static final class id { public static final int btn_id=0x7f070003; public static final int et_id1=0x7f070000; public static final int et_id2=0x7f070002; public static final int menu_settings=0x7f070005; public static final int reslut_id=0x7f070004; public static final int tv_id=0x7f070001; } public static final class layout { public static final int main=0x7f030000; public static final int other=0x7f030001; } public static final class menu { public static final int main=0x7f060000; } public static final class string { public static final int app_name=0x7f040000; public static final int cal=0x7f040001; public static final int menu_settings=0x7f040004; public static final int mulit=0x7f040003; public static final int result=0x7f040002; } public static final class style { /** Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. API 11 theme customizations can go here. Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f050000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f050001; } }
最新技术文章: