TodoViewController *contentViewController = [[TodoViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:contentViewController];
navigationController.contentSizeForViewInPopover = CGSizeMake(100, 100); //内容大小
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:navigationController];
popover.popoverContentSize = CGSizeMake(300, 300); //弹出窗口大小,如果屏幕画不下,会挤小的。这个值默认是320x1100
CGRect popoverRect = CGRectMake(200, 700, 10, 10);
[popover presentPopoverFromRect:popoverRect //popoverRect的中心点是用来画箭头的,如果中心点如果出了屏幕,系统会优化到窗口边缘
inView:self.view //上面的矩形坐标是以这个view为参考的
permittedArrowDirections:UIPopoverArrowDirectionDown //箭头方向
animated:YES];
[contentViewController release];
[navigationController release];
//最佳实践,使用哪个view做参考,就以哪个view的bounds送进去就好了,箭头自动指向这个view的中心
1 )请参考这3篇文章:
http://www.cocoachina.com/bbs/read.php?tid-21718.html
http://www.cocoachina.com/bbs/read.php?tid-19298.html
http://www.cocoachina.com/bbs/read.php?tid-15372.html
2)iPad 至少支持一个方向的180度旋转。推荐支持4个方向。并提供横向与纵向的启动画面。
default图片怎么样根据ipad的方向来变换方向????
3)iPad版尽量提供较iPhone版本增强的内容:
http://www.cocoachina.com/bbs/read.php?tid-22157.html
4) default.png for ipad
5) Pad软件提交注意事项
6) updating...
要在两个ImageView中显示用一张图片,而使它们的透明度不一样,利用Drawable对象的setAlpha()方法可以改变透明度,但是由于是同一张图片,底层只有一个Drawable对象,所以改变透明度的时候,所有显示的图片的透明度均会被更改,调用mutate()方法,可以使Drawable对象生成不同的constantstate对象,修改时就不会影响其它drawable对象的状态,但是调用后,不起作用,请会的朋友帮忙解答一下,先行谢过!
测试代码
package com.zhou.activity;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.ImageView;
public class DrawableActivity extends Activity {
ImageView myImageView;
ImageView myImageView2;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myImageView = (ImageView) this.findViewById(R.id.myImageView);
myImageView2 = (ImageView) this.findViewById(R.id.myImageView2);
//取得图片
Resources res = this.getResources();
Drawable drawable = res.getDrawable(R.drawable.link);
//不透明
drawable.mutate().setAlpha(255);
myImageView.setImageDrawable(drawable);
//透明
drawable.mutate().setAlpha(55);
myImageView2.setImageDrawable(drawable);
}
} 你要设置两个drawable (d1,d2),然后再分别mutate.setAlpha(255或者55),这样不同了。
你可以试验下,不用mutate()的话,即使d1.setAlpha(255),当d2.setAlpha(55)的时候,d1的alpha也会变成55的,因为貌似setalpha是直接在改变引用对象的。