English 中文(简体)
在我个人看来,我怎么能知道,装置方向发生了变化?
原标题:How can I know in my own view that device orientation has changed?

我延伸了GisFfaller的植被。 当我通过名单反对时,我先把我的《意见书》。 我的《意见书》录用了这份清单,并向我的《意见书》附录增加了一些看法。

我的活动和星体:组合式板Hiddenorientation”,根据我的看法,在装置方向发生变化时,没有重新计算。

哪一种方法 在我的《意见书》中,我必须首先处理改变方向的活动,以便在我的《意见书》中驳斥我对儿童的看法?

其他人如何看待?

Methid, that perform List of object in MyViewFlipper:

public void setUsers(List<User> users)
{
    removeAllViews();

    Display display = ((WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
    int maxWidth = display.getWidth();

    screens = new LinearLayout[maxScreens];
    int fillingScreen = maxScreens;

    while(fillingScreen > 0) 
    {
        LinearLayout linearLayout = new LinearLayout(getContext());
        linearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
        linearLayout.setGravity(Gravity.CENTER);
        screens[fillingScreen - 1] = linearLayout;
        fillingScreen --;
    }

    int currentUser = 0;

    while(currentUser < users.size() && fillingScreen < maxScreens)
    {

        LinearLayout linearLayout = (LinearLayout) inflater.inflate(R.layout.item_people_category_item, null);
        ImageView iv = (ImageView) linearLayout.findViewById(R.id.item_people_category_item_avatar);

        screens[fillingScreen].addView(linearLayout);
        screens[fillingScreen].measure(0, 0);

        if (screens[fillingScreen].getMeasuredWidth() >= maxWidth)
        {
            screens[fillingScreen].removeView(linearLayout);
            addView(screens[fillingScreen]);
            fillingScreen ++;
        }
        else 
        {
            User user = users.get(currentUser);
            iv.setOnClickListener(ouUserClicked);
            linearLayout.setTag(user);
            App._IMAGEMANAGER.setImage(user.getPhoto(), iv, R.drawable.no_photo);
            currentUser++;
        }
    }

    if (fillingScreen < maxScreens && screens[fillingScreen].getParent() == null) addView(screens[fillingScreen]);
}

简而言之,它添加了一些LinwarLayout,以 View西姆可观的物体。

PS:

   @Override
    public void onConfigurationChange(Configuration newConf) {
      // notify view flopper here
    }

我提出的其他意见无需通知。 它们改变代表制。 他们使用的Whih方法? ?

最佳回答

你们应该战胜一切。

 @Override
public void onConfigurationChanged(Configuration newConfig) {
 super.onConfigurationChanged(newConfig);
}

(a) 查明方向的变化......

问题回答

这不是一种观点方法,而是活动的基本方法:

@Override
public void onConfigurationChange(Configuration newConf) {
  // notify view flopper here
}




相关问题
Mysql trigger/events vs Cronjob

I have an auction website which let my users place an unlimited amount of autobiddings. To monitor these autobiddings something has to check the database every second. My question is if it is ...

Can an event be used as an event listener?

I m trying to expose some events from a private object which is contained inside the object I am creating and it looks like the compiler is happy with this: private WindowUpdateServer ...

鸡奸

由于将javascript DOM方法放在第html页底部(在<有人>之后)远比利用“j Query”准备活动要快得多,因此我们不得不这样做:

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

jQuery bind on ajax load() event

I have a page which displays multiple blocks with results details. Inside each block I have some <a> tags with thickbox jQuery plugin attached: class="thickbox" Here is an example of one kind ...

HTML text input event

I have a form, and want to disable/enable its submit button depending on whether the form s input text fields are empty or have had text entered into them. I think this means having an event handler ...

IE doesn t run Javascript when you click back button

I ve built a shop with tons of JS running. One of the pieces of the cart, is a zip code field which is required to calculate shipping cost. This works fine going through the cart. Now clicking ...

热门标签