`

Android学习08-----Android中的基本控件(下)(4)_Toast ImageSwitcher TextSwitcher

阅读更多

 

一、信息提示框: Toast

1 、提示文字信息

Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <Button
        android:id="@+id/butA"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="长时间显示Toast" />

    <Button
        android:id="@+id/butB"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="短时间显示Toast" />

</LinearLayout>

 

Toast01Activity.java

package com.iflytek.demo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class Toast01Activity extends Activity {
	private Button butA = null;
	private Button butB = null;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		this.butA = (Button) super.findViewById(R.id.butA);
		this.butB = (Button) super.findViewById(R.id.butB);
		this.butA.setOnClickListener(new OnClickListenerImplLong());
		this.butB.setOnClickListener(new OnClickListenerImplShort());

	}

	private class OnClickListenerImplLong implements OnClickListener {

		@Override
		public void onClick(View v) {
			Toast.makeText(Toast01Activity.this, "长时间显示的Toast信息提示框",
					Toast.LENGTH_LONG).show();
		}

	}

	private class OnClickListenerImplShort implements OnClickListener {

		@Override
		public void onClick(View v) {
			Toast.makeText(Toast01Activity.this, "短时间显示的Toast信息提示框",
					Toast.LENGTH_SHORT).show();
		}

	}
}

 

2 、自定义显示风格

Toast02Activity.java

package com.iflytek.demo;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;

public class Toast02Activity extends Activity {
	private Button but = null;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		this.but = (Button) super.findViewById(R.id.but);
		this.but.setOnClickListener(new OnClickListenerImpl());
	}

	private class OnClickListenerImpl implements OnClickListener {

		@Override
		public void onClick(View v) {
			Toast myToast = Toast.makeText(Toast02Activity.this, "安徽合肥",
					Toast.LENGTH_LONG);
			myToast.setGravity(Gravity.CENTER, 60, 30);
			LinearLayout myToastView = (LinearLayout) myToast.getView(); // 线性布局
			ImageView img = new ImageView(Toast02Activity.this);
			img.setImageResource(R.drawable.ic_launcher);
			myToastView.addView(img, 0); // 放在最前面
			myToast.show();
		}

	}
}

 

二、图片切换: ImageSwitcher

Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ImageSwitcher
        android:id="@+id/myImageSwitcher"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/butPrevious"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:enabled="false"
            android:text="上一张图片" />

        <Button
            android:id="@+id/butNext"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:enabled="true"
            android:text="下一张图片" />
    </LinearLayout>

</LinearLayout>

 

ImageSwitcherActivity.java

package com.iflytek.demo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageSwitcher;
import android.widget.ImageView;
import android.widget.ViewSwitcher.ViewFactory;

public class ImageSwitcherActivity extends Activity {
	private Button butPrevious = null;
	private Button butNext = null;
	private ImageSwitcher myImageSwitcher = null;
	private int[] imgRes = new int[] { R.drawable.ispic_a, R.drawable.ispic_b,
			R.drawable.ispic_c, R.drawable.ispic_d, R.drawable.ispic_e };
	private int foot = 0; // 表示当前已经显示的数组图片的脚标

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		this.myImageSwitcher = (ImageSwitcher) super
				.findViewById(R.id.myImageSwitcher);
		this.butPrevious = (Button) super.findViewById(R.id.butPrevious);
		this.butNext = (Button) super.findViewById(R.id.butNext);

		this.myImageSwitcher.setFactory(new ViewFactoryImpl());
		this.myImageSwitcher.setImageResource(this.imgRes[this.foot++]);

		this.myImageSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_in));

		this.myImageSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_out));

		this.butPrevious.setOnClickListener(new OnClickListenerPrevious());
		this.butNext.setOnClickListener(new OnClickListenerNext());
	}

	private class OnClickListenerPrevious implements OnClickListener {

		@Override
		public void onClick(View view) {
			ImageSwitcherActivity.this.myImageSwitcher
					.setImageResource(ImageSwitcherActivity.this.imgRes[ImageSwitcherActivity.this.foot--]);
			ImageSwitcherActivity.this.checkButEnable();
		}

	}

	private class OnClickListenerNext implements OnClickListener {

		@Override
		public void onClick(View view) {
			ImageSwitcherActivity.this.myImageSwitcher
					.setImageResource(ImageSwitcherActivity.this.imgRes[ImageSwitcherActivity.this.foot++]);
			ImageSwitcherActivity.this.checkButEnable();
		}

	}

	private void checkButEnable() { // 判断按钮是否可用
		if (this.foot < this.imgRes.length - 1) {
			this.butNext.setEnabled(true);
		} else {
			this.butNext.setEnabled(false);
		}
		if (this.foot == 0) {
			this.butPrevious.setEnabled(false);
		} else {
			this.butPrevious.setEnabled(true);
		}
	}

	private class ViewFactoryImpl implements ViewFactory {
		@Override
		public View makeView() {
			ImageView img = new ImageView(ImageSwitcherActivity.this);
			img.setBackgroundColor(0xFFFFFFFF); // 设置背景
			img.setScaleType(ImageView.ScaleType.CENTER);
			img.setLayoutParams(new ImageSwitcher.LayoutParams(
					LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); // 定义组件
			return img;
		}

	}
}

 

三、文本切换: TextSwitcher

Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextSwitcher
        android:id="@+id/myTextSwitcher"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <Button
        android:id="@+id/but"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="显示当前时间" />

</LinearLayout>

 

TextSwitcherActivity.java

package com.iflytek.demo;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.TextSwitcher;
import android.widget.TextView;
import android.widget.ViewSwitcher.ViewFactory;

public class TextSwitcherActivity extends Activity {
	private TextSwitcher myTextSwitcher = null;
	private Button but = null;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		this.myTextSwitcher = (TextSwitcher) super
				.findViewById(R.id.myTextSwitcher);
		this.but = (Button) super.findViewById(R.id.but);
		this.myTextSwitcher.setFactory(new ViewFactoryImpl());
		this.myTextSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_in));
		this.myTextSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_out));
		this.but.setOnClickListener(new OnClickListenerImpl());
	}

	private class OnClickListenerImpl implements OnClickListener {
		@Override
		public void onClick(View v) {
			TextSwitcherActivity.this.myTextSwitcher.setText("当前时间为:"
					+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
							.format(new Date()));
		}
	}

	private class ViewFactoryImpl implements ViewFactory {
		@Override
		public View makeView() {
			TextView txt = new TextView(TextSwitcherActivity.this);
			txt.setBackgroundColor(0xFFFFFFFF);
			txt.setTextColor(0xFF000000);
			txt.setLayoutParams(new TextSwitcher.LayoutParams(
					LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
			txt.setTextSize(30);
			return txt;
		}

	}
}

 

四、拖拉图片: Gallery

1 BaseAdapter 实现

Gallery01_BaseAdapterActivity.java

package com.iflytek.demo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Gallery;
import android.widget.Toast;

public class Gallery01_BaseAdapterActivity extends Activity {
	private Gallery gallery = null;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        this.gallery = (Gallery) super.findViewById(R.id.myGallery);
		this.gallery.setAdapter(new ImageGalleryAdapter(this));
		this.gallery.setOnItemClickListener(new OnItemClickListenerImpl()) ;
    }
    
    private class OnItemClickListenerImpl implements OnItemClickListener {

		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
			Toast.makeText(Gallery01_BaseAdapterActivity.this, String.valueOf(position),
					Toast.LENGTH_SHORT).show();
		}
	}
}

 

ImageGalleryAdapter.java

package com.iflytek.demo;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

public class ImageGalleryAdapter extends BaseAdapter {
	private Context context = null;
	// 里面的所有方法表示的是可以根据指定的显示图片的数量,进行每个图片的处理
	private int[] imgRes = new int[] { R.drawable.ispic_a, R.drawable.ispic_b,
			R.drawable.ispic_c, R.drawable.ispic_d, R.drawable.ispic_e }; // 这些是所要显示的图片的资源

	public ImageGalleryAdapter(Context context) {
		this.context = context;
	}

	@Override
	public int getCount() { // 取得要显示的内容的数量
		return this.imgRes.length; // 资源的数量
	}

	@Override
	public Object getItem(int position) {
		return this.imgRes[position];
	}

	@Override
	public long getItemId(int position) { // 取得项的ID
		return this.imgRes[position];
	}

	// 将资源设置到一个组件之中,很明显这个组件就是ImageView组件
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ImageView img = new ImageView(this.context);
		img.setBackgroundColor(0xFFFFFFFF);
		img.setImageResource(this.imgRes[position]); // 将指定的资源设置到ImageView中
		img.setScaleType(ImageView.ScaleType.CENTER); // 居中显示
		img.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT));
		return img;
	}

}

 

 

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <Gallery
        android:id="@+id/myGallery"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:spacing="3px" />

</LinearLayout>

 

 

2 SimpleAdapter 实现

grid_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="horizontal" 
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:background="#FFFFFF">
	<ImageView
		android:id="@+id/img"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content" 
		android:scaleType="center"/> 
</LinearLayout>

 

 

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

   <Gallery
		android:id="@+id/myGallery" 
		android:gravity="center_vertical"
		android:spacing="3px" 
		android:layout_width="fill_parent"
		android:layout_height="wrap_content" />

</LinearLayout>

 

Gallery02_SimpleAdapterActivity.java

package com.iflytek.demo;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Gallery;
import android.widget.SimpleAdapter;
import android.widget.Toast;

public class Gallery02_SimpleAdapterActivity extends Activity {
	private Gallery gallery = null;
	private SimpleAdapter simpleAdapter = null;
	private List<Map<String, Integer>> list = new ArrayList<Map<String, Integer>>();

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		this.initAdapter();
		this.gallery = (Gallery) super.findViewById(R.id.myGallery);
		this.gallery.setAdapter(this.simpleAdapter);
		this.gallery.setOnItemClickListener(new OnItemClickListenerImpl());
	}

	private void initAdapter() {
		Field[] fields = R.drawable.class.getDeclaredFields(); // 取得全部的属性
		for (int x = 0; x < fields.length; x++) {
			if (fields[x].getName().startsWith("ispic_")) { // 我们所需要的图片
				Map<String, Integer> map = new HashMap<String, Integer>();
				try {
					map.put("img", fields[x].getInt(R.drawable.class)); // 必须定义好名称是img
				} catch (Exception e) {
				}
				this.list.add(map);
			}
		}
		this.simpleAdapter = new SimpleAdapter(this, this.list,
				R.layout.grid_layout, new String[] { "img" },
				new int[] { R.id.img });
	}

	private class OnItemClickListenerImpl implements OnItemClickListener {

		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
			Toast.makeText(Gallery02_SimpleAdapterActivity.this,
					String.valueOf(position), Toast.LENGTH_SHORT).show();
		}
	}
}

 

 

3 、图片浏览

Gallery03_Activity.java

package com.iflytek.demo;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Gallery;
import android.widget.ImageSwitcher;
import android.widget.ImageView;
import android.widget.SimpleAdapter;
import android.widget.ViewSwitcher.ViewFactory;

public class Gallery03_Activity extends Activity {
	private Gallery gallery = null;
	private SimpleAdapter simpleAdapter = null;
	private List<Map<String, Integer>> list = new ArrayList<Map<String, Integer>>();
	private ImageSwitcher myImageSwitcher = null;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		this.initAdapter();
		this.gallery = (Gallery) super.findViewById(R.id.myGallery);
		this.myImageSwitcher = (ImageSwitcher) super
				.findViewById(R.id.myImageSwitcher);
		this.gallery.setAdapter(this.simpleAdapter);
		this.myImageSwitcher.setFactory(new ViewFactoryImpl());
		this.gallery.setOnItemClickListener(new OnItemClickListenerImpl());
	}

	private void initAdapter() {
		Field[] fields = R.drawable.class.getDeclaredFields(); // 取得全部的属性
		for (int x = 0; x < fields.length; x++) {
			if (fields[x].getName().startsWith("ispic_")) { // 我们所需要的图片
				Map<String, Integer> map = new HashMap<String, Integer>();
				try {
					map.put("img", fields[x].getInt(R.drawable.class)); // 必须定义好名称是img
				} catch (Exception e) {
				}
				this.list.add(map);
			}
		}
		this.simpleAdapter = new SimpleAdapter(this, this.list,
				R.layout.grid_layout, new String[] { "img" },
				new int[] { R.id.img });
	}

	private class OnItemClickListenerImpl implements OnItemClickListener {

		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
			Map<String, Integer> map = (Map<String, Integer>) parent
					.getAdapter().getItem(position);
			Gallery03_Activity.this.myImageSwitcher.setImageResource(map.get("img"));
		}
	}

	private class ViewFactoryImpl implements ViewFactory {

		@Override
		public View makeView() {
			ImageView img = new ImageView(Gallery03_Activity.this);
			img.setBackgroundColor(0xFFFFFFFF);
			img.setScaleType(ImageView.ScaleType.CENTER);
			img.setLayoutParams(new ImageSwitcher.LayoutParams(
					LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
			return img;
		}

	}
}

 

 

grid_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="horizontal" 
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:background="#FFFFFF">
	<ImageView
		android:id="@+id/img"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content" 
		android:scaleType="center"/> 
</LinearLayout>

 

 

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ImageSwitcher
        android:id="@+id/myImageSwitcher"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <Gallery
        android:id="@+id/myGallery"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:spacing="3px" />

</LinearLayout>

 

 

分享到:
评论

相关推荐

    Android代码-Android_Learning_Notes

    4、Android04--Android服务 5、Android05--Android服务通信 6、Android06--Android广播接收器 7、Android07--Android日志系统 8、Android08--Android权限系统 用户界面 9、Android09--Fragment初探 10、Android09--...

    Android自定义控件---联系人列表A-Z排序

    在Android开发中,自定义控件是提升应用用户体验和界面独特性的重要手段。本文将深入探讨如何创建一个自定义的联系人列表,并实现A-Z字母排序功能。首先,我们需要理解Android系统的视图(View)和视图组(ViewGroup)...

    android-support-v4.jar最新版

    在Android 3.0(API级别11)及以上版本中引入,但v4库使其可以在低至Android 1.6(API级别4)的版本上使用。 - **Loader**: Loader是一种异步加载数据的机制,它在后台线程中执行,避免了主线程的阻塞。v4库提供了`...

    Android-TrapezoidPartsView-梯形控件

    在Android开发中,有时我们需要创建一些独特形状的视图,以实现特定的界面设计或交互效果。...通过研究其源码,我们可以学习到如何在Android中实现自定义视图的绘制和事件监听,进一步提升我们的Android开发技能。

    android支持包:android-support-v4

    Android Support Library V4,简称`android-support-v4`,是Android开发者广泛使用的库,旨在提供对Android早期版本的兼容性,同时包含许多先进的特性,使得应用能够运行在从Android 2.1 (API级别7)到最新的Android...

    android-support-v7-appcompat

    在实际开发中,`appcompat-v7`库的使用方法通常是将其导入到项目中,然后将Activity继承自`AppCompatActivity`,并使用`android.support.v7.widget`包下的控件来替代原生的Android控件,这样就能在所有支持的Android...

    android基本控件练习

    - **官方文档**:深入学习Android官方文档中关于UI控件的部分。 - **实战项目**:尝试在真实的项目中应用这些控件,加深理解。 - **社区资源**:参与社区讨论,了解最新的开发技巧和最佳实践。 通过上述介绍,我们...

    Android-lib_axure.rar_Android-lib_axure_Axure_android_axure andr

    该库包含的组件涵盖了Android系统中的常见控件,如按钮、文本框、列表视图、滑动选择器等,甚至包括了一些复杂组件,如滑动导航栏、底部导航、折叠式布局等。这些组件不仅外观逼真,还支持各种交互动作,如点击、...

    mockable-android-26_wearess_android源码_android_

    4. **UI设计与布局**:XML文件用于创建Android应用的用户界面,包括Activity、Fragment和各种View控件。Android Studio的布局编辑器可以帮助快速设计和预览界面。 5. **权限管理**:在Android 6.0(API级别23)及...

    android-support-v4/v7 26 27 28三个版本下载

    `android-support-v4`库是为了保证在Android API Level 4(即Android 1.6)以上版本运行的功能兼容性,而`appcompat-v7`库则提供了对Android Material Design设计风格的支持,并且同样确保在低版本系统上的兼容。...

    android-times-square日历控件

    《Android Times-Square:打造出色的日历控件》 在移动应用开发中,日历控件是不可或缺的一部分,它能够帮助用户方便地选择日期,进行时间管理。Square公司开源的`android-times-square`库,正是为Android平台量身...

    android-support-v7-appcompat.jar android-support-v4.jar

    `android-support-v4.jar` 则是另一个广泛使用的库,它包含了大量在Android 4.0(API级别14)及更高版本中可用的功能,但向下兼容到Android 1.6(API级别4)。这个库提供了许多关键服务和组件,如Fragment、Loader、...

    android studio 基本控件

    ### Android Studio 基本控件详解 #### LinearLayout 布局详解 LinearLayout 是 Android 开发中最常用的布局之一,它可以将界面元素沿着一个方向(横向或纵向)排列。通过 `android:orientation` 属性可以控制布局...

    android-support-v7-appcompat.zip

    它还提供了自定义视图和控件的工具,比如`android.support.v7.widget.CardView`和`android.support.v7.widget.RecyclerView`,这些都在早期版本的Android上提供原生支持。 总之,`android-support-v7-appcompat`是...

    android学习文档--控件1.pptx

    以上介绍了Android UI中常用的几种基本控件及其使用方法。这些控件是构建用户界面的基础,熟练掌握它们的使用可以帮助开发者快速搭建出美观实用的应用界面。希望本文能为初学者提供一定的帮助。

    Mobile-SDK-Android-master_DEMO_android_

    4. **Android UI设计**:DEMO中的用户界面展示了如何创建控件来显示无人机状态、操作飞行控制等,这涉及到Android的布局设计和事件监听机制。 5. **蓝牙与WiFi通信**:大疆无人机的控制通常通过蓝牙或WiFi进行,...

    android-gif-drawable-master.zip_android_android gif

    这个库名为`android-gif-drawable`,它优化了GIF在Android控件中的显示性能,解决了原生Android API在处理GIF时的一些局限性。 首先,我们要理解Android原生对GIF支持的不足。Android SDK并没有提供内置的API来直接...

    Android---UI篇

    •Android---UI篇---Tab Layout(选项卡布局) • •Andorid---UI篇---TableLayout(表格布局) • •Android---UI篇---RelativeLayout(相对布局) • •Android---UI篇---GridView(网格布局) • •Android---UI篇-...

    Android聊天控件Android-Chat-Widget.zip

    Android-Chat-Widget 是像微信、WhatsApp、Line一样的聊天控件。 Demo 如何使用? 1.在Layout中  android:id="@ id/messageInputToolBox"  android:layout_width="match_parent"  ...

    android-support-v4.jar android-support-v7.jar

    在Android开发中,`android-support-v4.jar`和`android-support-v7.jar`是两个非常重要的库文件,它们属于Google的Android Support Library。这个库是为了兼容Android的不同版本而设计的,尤其是在处理旧版本API时,...

Global site tag (gtag.js) - Google Analytics