电商网站建设实训心得网络公司哪个平台好
电商网站建设实训心得,网络公司哪个平台好,湖南建设人力资源网和报考平台,赤峰网站制作定义#xff0c;在这两种资源的文件出现在你的代码 并在onCreate()在所有视图中Activity可以检查方向绑定的意见#xff0c;你的类的对象。示例。在这里我们有包含在这两个文件的ImageView的#xff0c;并在画像文件有一个TextView和景观它包含Button代替TextViewmy_layout.…定义在这两种资源的文件出现在你的代码 并在onCreate()在所有视图中Activity可以检查方向绑定的意见你的类的对象。示例。在这里我们有包含在这两个文件的ImageView的并在画像文件有一个TextView和景观它包含Button代替TextViewmy_layout.xml在布局2个布局文件-landandroid:idid/button1android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:textButton /android:idid/imageView1android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:srcdrawable/abs__ab_bottom_solid_dark_holo /my_layout.xml在布局端口文件夹android:idid/imageView1android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:srcdrawable/abs__ab_bottom_solid_dark_holo /android:idid/textView1android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:textTextView /这里是活动代码package com.example.stackoverflow;import android.app.Activity;import android.content.res.Configuration;import android.os.Bundle;import android.view.Display;import android.widget.Button;import android.widget.ImageView;import android.widget.TextView;public class MyActivity extends Activity {// landscape viewsButton button1;// protrati viewsTextView textView1;// common views (shared between landscape and protrait mode)ImageView imageView1;public MyActivity() {// TODO Auto-generated constructor stub}Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.my_layout);imageView1 (ImageView) findViewById(R.id.imageView1);//exist inside landscape file and portraitif(getScreenOrientation() Configuration.ORIENTATION_PORTRAIT){textView1 (TextView)findViewById(R.id.textView1);}else{button1 (Button) findViewById(R.id.button1);}//when you want to access any thing that is not shared//check the orientation}Overrideprotected void onResume() {super.onResume();//let say that we want here to set a text on the textview and its available only for protraitif(getScreenOrientation() Configuration.ORIENTATION_PORTRAIT){//wont be null :) so we can set the texttextView1.setText(Hello Guys!);}}// http://stackoverflow.com/a/6236110/671676public int getScreenOrientation() {Display getOrient getWindowManager().getDefaultDisplay();int orientation Configuration.ORIENTATION_UNDEFINED;if (getOrient.getWidth() getOrient.getHeight()) {orientation Configuration.ORIENTATION_SQUARE;} else {if (getOrient.getWidth() getOrient.getHeight()) {orientation Configuration.ORIENTATION_PORTRAIT;} else {orientation Configuration.ORIENTATION_LANDSCAPE;}}return orientation;}}问什么你不明白。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/87242.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!