ListItemClick olayında listactivity bir pop-up penceresi oluşturuyorum.Android'de açılan pencere boyutu
LayoutInflater inflater = (LayoutInflater)
this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View pop = inflater.inflate(R.layout.popupcontact, null, false);
ImageView atnot = (ImageView)pop.findViewById(R.id.aNot);
height = pop.getMeasuredHeight();
width = pop.getMeasuredWidth();
Log.e("pw","height: "+String.valueOf(height)+", width: "+String.valueOf(width));
atnot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pw.dismiss();
}
});
pw = new PopupWindow(pop, width, height, true);
// The code below assumes that the root container has an id called 'main'
//pw.showAtLocation(v, Gravity.CENTER, 0, 0);
pw.showAsDropDown(v, 10, 5);
Şimdi, yükseklik ve genişlik değişkenler açılır pencere (popupcontact) için kullanılan düzen yüksekliği ve genişliği olması gerekiyordu. Ama 0 döndürüyorlar. Sanırım bu, düzenin henüz işlenmemiş olması. Herkesin bir ipucu var mı, mutlak piksel sayılarını kullanmanıza gerek kalmadan pop-up penceresinin boyutunu nasıl kontrol edebilirim?
Am da aynı sorunu bakan) getMeasuredHeight() ve getMeasuredWidth (ile düzen boyutunu almadan önce. Bu çalışır, ancak yukarıdaki kod özgün – vignesh
yukarıdaki kodu bana boş bir işaretçi istisnası verir. – Amrut