使用自定義RadioButton和ViewPager實現TabHost效果和帶滑動的頁卡效果。

?? 參考自http://www.apkbus.com/android-86125-1-1.html

?? 這篇文章技術含量一般,大家別見笑。源碼我以測試,在底部可下載。 ?? 好了先上效果圖:

以下是實現步驟:???????

1、準備自定義RadioButton控件的樣式圖片等,就是準備配置文件:
(1)、? 在項目的values文件夾里面創建 attrs.xml :

?

?
<?xml version="1.0" encoding="utf-8"?>
<resources>
??? <declare-styleable name="MyRadioButton">
??????? <attr name="pic" format="reference" />
??? </declare-styleable>
</resources>

?

(2)、創建 styles.xml:

?
<?xml version="1.0" encoding="utf-8"?>
<resources>
??? <style name="radioButtonStyle">
??????? <item name="android:button">@null</item>
??????? <item name="android:textSize">12dip</item>
??????? <item name="android:gravity">center_horizontal|bottom</item>
??????? <item name="android:paddingBottom">5dip</item>
??? </style>
</resources>

(3)、把中文定義在string.xml里:

?

?
<?xml version="1.0" encoding="utf-8"?>
<resources>
??? <string name="hello">Hello World, MainAct!</string>
??????? <string name="app_name">TabHost</string>
??????? <string name="home">大廳</string>
??????? <string name="account">用戶</string>
??????? <string name="beanExchange">玩具</string>
??????? <string name="winAcciche">公告</string>
??????? <string name="more">更多</string>
</resources>

(4)、??? 創建MyRadioButton類繼承RadioButton:

?
package com.dome.viewer.widget;
import com.dome.viewer.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
import android.util.AttributeSet;
import android.widget.RadioButton;
public class MyRadioButton extends RadioButton {
??????? private Drawable drawable;
??????? public MyRadioButton(Context context, AttributeSet attrs) {
??????????????? super(context, attrs);
??????????????? TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MyRadioButton);
??????????????? drawable = a.getDrawable(R.styleable.MyRadioButton_pic);
??????? }
??????? //Drawable轉換成Bitmap
??????? private Bitmap drawable2Bitmap(Drawable drawable) {
??????????????? if (drawable instanceof BitmapDrawable) {
??????????????????????? return ((BitmapDrawable) drawable).getBitmap();
??????????????? } else if (drawable instanceof NinePatchDrawable) {
??????????????????????? Bitmap bitmap = Bitmap
??????????????????????????????????????? .createBitmap(
??????????????????????????????????????????????????????? drawable.getIntrinsicWidth(),
??????????????????????????????????????????????????????? drawable.getIntrinsicHeight(),
??????????????????????????????????????????????????????? drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888
??????????????????????????????????????????????????????????????????????? : Bitmap.Config.RGB_565);
??????????????????????? Canvas canvas = new Canvas(bitmap);
??????????????????????? drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
??????????????????????? drawable.draw(canvas);
??????????????????????? return bitmap;
??????????????? } else {
??????????????????????? return null;
??????????????? }
??????? }
??????? @Override
??????? protected void onDraw(Canvas canvas) {
??????????????? super.onDraw(canvas);
??????????????? Bitmap image = drawable2Bitmap(drawable);
??????????????? if (image != null) {
??????????????????????? Paint pt = new Paint();
??????????????????????? pt.setARGB(255, 66, 66, 66);
??????????????????????? // 消除鋸齒
??????????????????????? pt.setAntiAlias(true);
??????????????????????? // 居中顯示圖片
??????????????????????? int imageX = (int) (this.getWidth() - image.getWidth()) / 2;
??????????????????????? canvas.drawBitmap(image, imageX, 2, pt);
??????????????????????? pt.setARGB(255, 255, 255, 255);
??????????????? }
??????? }
}

(5)、為Activity準備布局文件,命名為:tabhost.xml:

?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
??? xmlns:attrstest="http://schemas.android.com/apk/res/com.dome.viewer"
??? android:layout_width="fill_parent"
??? android:layout_height="fill_parent"
??? android:background="@drawable/bg" >
??? <RelativeLayout
??????? android:id="@+id/title"
??????? android:layout_width="fill_parent"
??????? android:layout_height="50dip"
??????? android:background="@drawable/bg_navigation" >
??????? <TextView
??????????? android:layout_width="fill_parent"
??????????? android:layout_height="fill_parent"
??????????? android:layout_centerVertical="true"
??????????? android:layout_marginLeft="5dip"
??????????? android:gravity="center"
??????????? android:text="首頁"
??????????? android:textSize="25dip" />
??? </RelativeLayout>
??? <android.support.v4.view.ViewPager
??????? android:id="@+id/vPager"
??????? android:layout_width="fill_parent"
??????? android:layout_height="fill_parent"
??????? android:layout_gravity="center"
??????? android:paddingBottom="55dip"
??????? android:persistentDrawingCache="animation" />
??? <RadioGroup
??????? android:id="@+id/rg_main_btns"
??????? android:layout_width="fill_parent"
??????? android:layout_height="50dip"
??????? android:layout_alignParentBottom="true"
??????? android:layout_gravity="bottom"
??????? android:background="@drawable/bg_navigation"
??????? android:gravity="center_horizontal"
??????? android:orientation="horizontal" >
??????? <com.dome.viewer.widget.MyRadioButton
??????????? android:id="@+id/buyHomeTab"
??????????? style="@style/radioButtonStyle"
??????????? android:layout_width="60dip"
??????????? android:layout_height="50dip"
??????????? android:background="@drawable/navigation_item"
??????????? android:checked="true"
??????????? attrstest:pic="@drawable/gcdt"
??????????? android:text="@string/home" />
??????? <com.dome.viewer.widget.MyRadioButton
??????????? android:id="@+id/winAfficheTab"
??????????? style="@style/radioButtonStyle"
??????????? android:layout_width="60dip"
??????????? android:layout_height="50dip"
??????????? android:background="@drawable/navigation_item"
??????????? android:button="@null"
??????????? attrstest:pic="@drawable/kjgg"
??????????? android:text="@string/winAcciche" />
??????? <com.dome.viewer.widget.MyRadioButton
??????????? android:id="@+id/integralTab"
??????????? style="@style/radioButtonStyle"
??????????? android:layout_width="65dip"
??????????? android:layout_height="50dip"
??????????? android:background="@drawable/navigation_item"
??????????? attrstest:pic="@drawable/jfdh"
??????????? android:text="@string/beanExchange" />
??????? <com.dome.viewer.widget.MyRadioButton
??????????? android:id="@+id/accountTab"
??????????? style="@style/radioButtonStyle"
??????????? android:layout_width="60dip"
??????????? android:layout_height="50dip"
??????????? android:background="@drawable/navigation_item"
??????????? attrstest:pic="@drawable/yhzx"
??????????? android:text="@string/account" />
??????? <com.dome.viewer.widget.MyRadioButton
??????????? android:id="@+id/moreTab"
??????????? style="@style/radioButtonStyle"
??????????? android:layout_width="60dip"
??????????? android:layout_height="50dip"
??????????? android:background="@drawable/navigation_item"
??????????? attrstest:pic="@drawable/more"
??????????? android:text="@string/more" />
??? </RadioGroup>
</RelativeLayout>

(6)、創建TabHostActivity:  

?
package com.dome.viewer;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.LocalActivityManager;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.RadioGroup;
public class TabHostActivity extends Activity {
???
????????
??????? @Override
??????? protected void onStart() {
??????????????? super.onStart();
??????? }
??????? private RadioGroup radioGroup;
????????
??????? // 頁卡內容
??????? private ViewPager mPager;
??????? // Tab頁面列表
??????? private List<View> listViews;
??????? // 當前頁卡編號
??????? private LocalActivityManager manager = null;
????????
??????? private MyPagerAdapter mpAdapter = null;
??????? private int index;
????????
??????? // 更新intent傳過來的值
??????? @Override
??????? protected void onNewIntent(Intent intent) {
??????????????? setIntent(intent);
??????? }
????????
??????? @Override
??????? protected void onSaveInstanceState(Bundle outState) {
???????????
??????? }
??????? @Override
??????? public void onBackPressed() {
??????????????? Log.i("","onBackPressed()");
??????????????? super.onBackPressed();
??????? }
??????? @Override
??????? protected void onPause() {
??????????????? Log.i("","onPause()");
??????????????? super.onPause();
??????? }
????????
??????? @Override
??????? protected void onStop() {
??????????????? Log.i("","onStop()");
??????????????? super.onStop();
??????? }
??????? @Override
??????? protected void onDestroy() {
??????????????? Log.i("","onDestroy()");
??????????????? super.onDestroy();
??????? }
????????
????????
??????? @Override
??????? protected void onResume() {
??????????????? super.onResume();
????????????????
??????????????? if(getIntent() != null){
??????????????????????? index = getIntent().getIntExtra("index", 0);
??????????????????????? mPager.setCurrentItem(index);
??????????????????????? setIntent(null);
??????????????? }else{
??????????????????????? if(index < 4){
??????????????????????????????? index = index+1;
??????????????????????????????? mPager.setCurrentItem(index);
??????????????????????????????? index = index -1;
??????????????????????????????? mPager.setCurrentItem(index);
????????????????????????????????
??????????????????????? }else if(index == 4){
??????????????????????????????? index= index-1;
??????????????????????????????? mPager.setCurrentItem(index);
??????????????????????????????? index = index +1;
??????????????????????????????? mPager.setCurrentItem(index);
??????????????????????? }
??????????????? }
??????? }
????????
??????? @Override
??????? protected void onCreate(Bundle savedInstanceState) {
??????????????? super.onCreate(savedInstanceState);
??????????????? requestWindowFeature(Window.FEATURE_NO_TITLE);
??????????????? setContentView(R.layout.tabhost);
??????????????? mPager = (ViewPager) findViewById(R.id.vPager);
??????????????? manager = new LocalActivityManager(this, true);
??????????????? manager.dispatchCreate(savedInstanceState);
??????????????? InitViewPager();
??????????????? radioGroup = (RadioGroup) this.findViewById(R.id.rg_main_btns);
??????????????? radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
??????????????????????????????????????? public void onCheckedChanged(RadioGroup group, int checkedId) {
??????????????????????????????????????????????? switch (checkedId) {
????????????????????????????????????????????????
??????????????????????????????????????????????? case R.id.buyHomeTab:
??????????????????????????????????????????????????????? index = 0;
??????????????????????????????????????????????????????? listViews.set(0, getView("A", new Intent(TabHostActivity.this, OneDomeActivity.class)));
??????????????????????????????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????????????????????????????? mPager.setCurrentItem(0);
??????????????????????????????????????????????????????? break;
????????????????????????????????????????????????????????
??????????????????????????????????????????????? case R.id.winAfficheTab:
??????????????????????????????????????????????????????? index = 1;
??????????????????????????????????????????????????????? listViews.set(1, getView("B", new Intent(TabHostActivity.this, TowDomeActivity.class)));
??????????????????????????????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????????????????????????????? mPager.setCurrentItem(1);
??????????????????????????????????????????????????????? break;
????????????????????????????????????????????????????????
??????????????????????????????????????????????? case R.id.integralTab:
??????????????????????????????????????????????????????? index = 2;
??????????????????????????????????????????????????????? listViews.set(2, getView("C", new Intent(TabHostActivity.this, ThreeDomeActivity.class)));
??????????????????????????????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????????????????????????????? mPager.setCurrentItem(2);
??????????????????????????????????????????????????????? break;
????????????????????????????????????????????????????????
??????????????????????????????????????????????? case R.id.accountTab:
??????????????????????????????????????????????????????? index = 3;
??????????????????????????????????????????????????????? listViews.set(3, getView("D", new Intent(TabHostActivity.this, FourDomeActivity.class)));
??????????????????????????????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????????????????????????????? mPager.setCurrentItem(3);
??????????????????????????????????????????????????????? break;
????????????????????????????????????????????????????????
??????????????????????????????????????????????? case R.id.moreTab:
??????????????????????????????????????????????????????? index = 4;
??????????????????????????????????????????????????????? listViews.set(4, getView("E", new Intent(TabHostActivity.this, FiveDomeActivity.class)));
??????????????????????????????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????????????????????????????? mPager.setCurrentItem(4);
??????????????????????????????????????????????????????? break;
??????????????????????????????????????????????? default:
??????????????????????????????????????????????????????? break;
??????????????????????????????????????????????? }
??????????????????????????????????????? }
??????????????????????????????? });
??????? }
????????
??????? /**
???????? * 初始化ViewPager
???????? */
??????? private void InitViewPager() {
??????????????? Intent intent = null;
??????????????? listViews = new ArrayList<View>();
??????????????? mpAdapter = new MyPagerAdapter(listViews);
??????????????? intent = new Intent(TabHostActivity.this, OneDomeActivity.class);
??????????????? listViews.add(getView("A", intent));
??????????????? intent = new Intent(TabHostActivity.this, TowDomeActivity.class);
??????????????? listViews.add(getView("B", intent));
??????????????? intent = new Intent(TabHostActivity.this, ThreeDomeActivity.class);
??????????????? listViews.add(getView("C", intent));
??????????????? intent = new Intent(TabHostActivity.this, FourDomeActivity.class);
??????????????? listViews.add(getView("D", intent));
??????????????? intent = new Intent(TabHostActivity.this, FiveDomeActivity.class);
??????????????? listViews.add(getView("E", intent));
??????????????? mPager.setOffscreenPageLimit(0);
??????????????? mPager.setAdapter(mpAdapter);
??????????????? mPager.setCurrentItem(0);
??????????????? mPager.setOnPageChangeListener(new MyOnPageChangeListener());
??????? }
??????? /**
???????? * ViewPager適配器
???????? */
??????? public class MyPagerAdapter extends PagerAdapter {
??????????????? public List<View> mListViews;
??????????????? public MyPagerAdapter(List<View> mListViews) {
??????????????????????? this.mListViews = mListViews;
??????????????? }
??????????????? @Override
??????????????? public void destroyItem(View arg0, int arg1, Object arg2) {
??????????????????????? ((ViewPager) arg0).removeView(mListViews.get(arg1));
??????????????? }
??????????????? @Override
??????????????? public void finishUpdate(View arg0) {
??????????????? }
??????????????? @Override
??????????????? public int getCount() {
??????????????????????? return mListViews.size();
??????????????? }
??????????????? @Override
??????????????? public Object instantiateItem(View arg0, int arg1) {
??????????????????????? ((ViewPager) arg0).addView(mListViews.get(arg1), 0);
??????????????????????? return mListViews.get(arg1);
??????????????? }
??????????????? @Override
??????????????? public boolean isViewFromObject(View arg0, Object arg1) {
??????????????????????? return arg0 == (arg1);
??????????????? }
??????????????? @Override
??????????????? public void restoreState(Parcelable arg0, ClassLoader arg1) {
??????????????? }
??????????????? @Override
??????????????? public Parcelable saveState() {
??????????????????????? return null;
??????????????? }
??????????????? @Override
??????????????? public void startUpdate(View arg0) {
??????????????? }
??????? }
??????? /**
???????? * 頁卡切換監聽,ViewPager改變同樣改變TabHost內容
???????? */
??????? public class MyOnPageChangeListener implements OnPageChangeListener {
??????????????? public void onPageSelected(int arg0) {
??????????????????????? manager.dispatchResume();
??????????????????????? switch (arg0) {
??????????????????????? case 0:
??????????????????????????????? index = 0;
??????????????????????????????? radioGroup.check(R.id.buyHomeTab);
??????????????????????????????? listViews.set(0, getView("A", new Intent(TabHostActivity.this, OneDomeActivity.class)));
??????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????? break;
??????????????????????? case 1:
??????????????????????????????? index = 1;
??????????????????????????????? radioGroup.check(R.id.winAfficheTab);
??????????????????????????????? listViews.set(1, getView("B", new Intent(TabHostActivity.this, TowDomeActivity.class)));
??????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????? break;
??????????????????????? case 2:
??????????????????????????????? index = 2;
??????????????????????????????? radioGroup.check(R.id.integralTab);
??????????????????????????????? listViews.set(2, getView("C", new Intent(TabHostActivity.this, ThreeDomeActivity.class)));
??????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????? break;
??????????????????????? case 3:
??????????????????????????????? index = 3;
??????????????????????????????? radioGroup.check(R.id.accountTab);
??????????????????????????????? listViews.set(3, getView("D", new Intent(TabHostActivity.this, FourDomeActivity.class)));
??????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????? break;
??????????????????????? case 4:
??????????????????????????????? index = 4;
??????????????????????????????? radioGroup.check(R.id.moreTab);
??????????????????????????????? listViews.set(4, getView("E", new Intent(TabHostActivity.this, FiveDomeActivity.class)));
??????????????????????????????? mpAdapter.notifyDataSetChanged();
??????????????????????????????? break;
??????????????????????? }
??????????????? }
??????????????? public void onPageScrolled(int arg0, float arg1, int arg2) {
??????????????? }
??????????????? public void onPageScrollStateChanged(int arg0) {
??????????????? }
??????? }
??????? private View getView(String id, Intent intent) {
??????????????? return manager.startActivity(id, intent).getDecorView();
??????? }
????????
}

(7)、然后依次創建5個Activity作為頁卡,和創建5個xml作為Activity的布局文件,如圖:  

 歡迎關注http://e.weibo.com/2975543812

源碼下載:http://files.cnblogs.com/feifei1010/TabHostDome.rar 

轉載于:https://www.cnblogs.com/crazywenza/archive/2013/01/23/2873362.html

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

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

相關文章

利益相關者軟件工程_改善開發人員團隊與非技術利益相關者之間交流的方法

利益相關者軟件工程Whether you’re working on a startup or a big company, keeping your stakeholders and non-technical partners engaged and up to date on what the tech team has been building can be hard.無論您是在初創公司還是大公司中工作&#xff0c;都要讓您的…

Hibernate的檢索策略

Hibernate的Session在加載一個Java對象時&#xff0c;可以將與這個對象相關聯的其他Java對象都加載到緩存中&#xff0c;以便程序及時調用。但有些情況下&#xff0c;我們不需要加載太多無用的對象到緩存中&#xff0c;一來這樣會撐爆內存&#xff0c;二來增加了訪問數據庫的次…

響應式網格項目動畫布局_響應式網格及其實際使用方式:常見的UI布局

響應式網格項目動畫布局重點 (Top highlight)第二部分 (Part II) Now that you have a basic understanding of how to use grids, you might be wondering how to apply them to layouts you see on the web. Responsive grids are a method to systematically align your des…

SQL函數大全

SQL函數大全 --聚合函數use pubsgoselect avg(distinct price) --算平均數from titleswhere typebusinessgo use pubsgoselect max(ytd_sales) --最大數from titlesgo use pubsgoselect min(ytd_sales) --最小數from titlesgo use pubsgoselect type,sum(price),sum(advanc…

時間軸ui設計_我應該在UI設計上花更多時間嗎?

時間軸ui設計Let’s start with an example of communication skills: they are important for any profession, and you expect any professional to have a decent level. However, excellent communication skills won’t make up for the lack of core expertise. Imagine …

一、Oracle介紹

Oracle學習筆記 一、 Oracle介紹 選擇數據庫的標準 項目的規模 負載量多大&#xff0c;用戶量多少 成本 安全性 Oracle 認證 初級&#xff1a;OCA&#xff1a;Oracle Certificated Associate 中級&#xff1a;OCP&#xff1a;Oracle Certificated Professional 高級&#xff…

移動端分步注冊_移動應用程序的可用性測試:分步指南

移動端分步注冊Written by Justin Mifsud由賈斯汀米夫蘇德 ( Justin Mifsud)撰寫 The mobile market is huge and growing at a very fast rate. With an estimated 4.5 billion subscribers worldwide, it is forecasted that the number of mobile phones will surpass the …

ldd隨筆(1)-linux設備模型

一下只是個人學習后的理解&#xff0c;可能有很多不對的地方。 要學習linux的設備驅動模型&#xff0c;首先必須要知道kobject和kset的概念&#xff0c;下面是kobject在2.6.38的源碼中的實現。 struct kobject {const char *name; //名稱&#xff0c;可能在sysfs中創…

插圖 引用 同一行兩個插圖_提出食物主題中的插圖

插圖 引用 同一行兩個插圖I have a page in my portfolio, which is about search functionality. I wanted that page to feel fun and engaging, to convey a positive vibe, so I decided to add illustrations to it.我的投資組合中有一個頁面與搜索功能有關。 我希望該頁面…

Hadoop的SequenceFile讀寫實例

1 SequenceFile可以處理hdfs上大量小文件&#xff0c;它可以作為大量小文件的容器。HDFS和MapReduce是針對大文件優化的&#xff0c;所以通過SequenceFile類型將小文件包裝起來可以獲得更高效的存儲和處理。存儲2 在SequenceFile中的鍵和值并不一定是Writable類型&#xff…

臉部細微表情識別_您可以僅使用面部表情來控制字體嗎?

臉部細微表情識別原型 (The prototype) Facetype is the name of Adam’s interactive project, in which the emotions detected from a person’s facial gestures control a variable font. To each detected emotion corresponds a specific typeface, which keeps transfo…

ssky-keygen + ssh-copy-id 無密碼登陸遠程LINUX主機

使用下例中ssky-keygen和ssh-copy-id&#xff0c;僅需通過3個步驟的簡單設置而無需輸入密碼就能登錄遠程Linux主機。 ssh-keygen 創建公鑰和密鑰。 ssh-copy-id 把本地主機的公鑰復制到遠程主機的authorized_keys文件上。ssh-copy-id 也會給遠程主機的用戶主目錄&#xff08;ho…

uva10891Game of sum

題意:經典的取石子游戲是這樣的:有一堆石子&#xff0c;A、B兩個人輪流取&#xff0c;每次取一顆&#xff0c;只能從邊上取&#xff0c;每個石子有相應的價值&#xff0c;A、B兩人都想使得自己的價值最多&#xff0c;兩個人足夠聰明&#xff0c;問最后價值分別是多少 本題則是可…

用戶體驗設計師能為seo做_用戶體驗設計師可以從產品設計歷史中學到什么

用戶體驗設計師能為seo做Many things have changed from tool design in the prehistoric era to today’s digital product design. However, we can see surprisingly many similarities. Especially when it comes down to one particular aspect: usability.從史前時代的工…

函數指針

顧名思義&#xff0c;指針函數即返回指針的函數。其一般定義形式如下&#xff1a; 類型名 *函數名(函數參數表列); 其中&#xff0c;后綴運算符括號“()”表示這是一個函數&#xff0c;其前綴運算符星號“*”表示此函數為指針型函數&#xff0c;其函數值為指針&#xff0c;即它…

orton效果_如何使圖片發光:Orton效果

orton效果Have you ever seen an impossibly dream-like landscape photo? One with a slow burning, glowing sunset. That’s really the best way to describe it, the image looks as if it’s glowing. You might be thinking, “wow, I wish I was that good and could …

UVA10785 The Mad Numerologist

雖然是sorting的壓軸&#xff0c;但是比起前面真心水題。這個專題結合前面string的很多&#xff0c;排序相對簡單了&#xff0c;qsort基本解決。 題目&#xff1a; The Mad Numerologist Numerology is a science that is used by many people to find out a mans personality,…

蘋果人機交互指南_蘋果人機界面設計指南的10個見解

蘋果人機交互指南重點 (Top highlight)I’ve been developing an IOS app for the past few months and have been constantly referring to Apple’s Human Interface Design Guidelines. I would consider it a must-read for any aspiring or current UI/UX designer.在過去…

也來學學插件式開發

上一家公司有用到插件式開發來做一個工具箱&#xff0c;類似于QQ電腦管家&#xff0c;有很多工具列表&#xff0c;點一下工具下載后就可以開始使用了。可惜在那家公司待的時候有點短&#xff0c;沒有好好研究一下。現在有空&#xff0c;自己在網上找了些資料&#xff0c;也來試…

同態加法_我對同態的想法

同態加法Early February, I uploaded this shot onto Dribbble. Nothing fancy –– just two screens experimenting with “2月初&#xff0c;我將這張照片上傳到Dribbble。 沒什么幻想–只有兩個屏幕在嘗試“ Neumorphism,” or soft UI. Little did I know that this post…