• 重写修改重写的Dialog显示问题


    最近使用开发的过程中出现了一个小问题,顺便记录一下原因和方法--重写修改

        重写和修改点击listview的行有时表现这样,有时表现畸形重写和修改

        ,此现象只出现在三星N7100真机上,,,重写的Dialog不好适配啊,怎么办?

        当我把屏幕先放横屏再放竖屏时,这个现象就就没有了,表现老是畸形!

        相关代码,如下所示.

        每日一道理
    听,是谁的琴声,如此凄凉,低调的音,缓慢的节奏,仿佛正诉说着什么。音低调得略微有些抖动,听起来似乎心也有些抖动,我感觉到一种压抑的沉闷气息,是否已凝结在这空气中……

        public void updatePrice(final int arg2) {//当点击ListView上的每一行时弹出对话框来修改珠宝的零售价和更换价
    LayoutInflater factory=LayoutInflater.from(Jjtz.this);
    final View v1=factory.inflate(R.layout.jjtzdialog,null);
    AlertDialog.Builder dialog=new AlertDialog.Builder(this);
    final AlertDialog alertDialogs = dialog.create();  
    TextView dmtxt=(TextView) v1.findViewById(R.id.dm);//表现成色代码
        TextView mctxt=(TextView) v1.findViewById(R.id.mc);//表现简称
        dmtxt.setText("成色代码:"+arrayList.get(arg2).get("dm").toString());
        mctxt.setText("简称:"+arrayList.get(arg2).get("mc").toString());
    dialog.setTitle("修改金价");
    dialog.setView(v1);
            dialog.setPositiveButton("肯定修改", new DialogInterface.OnClickListener() { 
                public void onClick(DialogInterface dialog, int whichButton) {         
                try{      //修改金价   
                EditText lsj=(EditText) v1.findViewById(R.id.lsj);//输入零售价
                   EditText dhj=(EditText) v1.findViewById(R.id.dhj);//输入更换价
                   final String lsjStr = lsj.getText().toString().trim();
               final String dhjStr = dhj.getText().toString().trim();
    final String dm=arrayList.get(arg2).get("dm").toString();
    new Thread(){
    public void run() {
    mHandler.sendEmptyMessage(CODE_HINT);
    try{
    if(lsjStr.length()!=0&&dhjStr.length()==0){
    parser.xml2list("http://........./updateJjtzLsj?lsj="+lsjStr+"&dm="+dm+"", 
    "diffgr:diffgram", "");}
    else if(lsjStr.length()==0&&dhjStr.length()!=0){
    parser.xml2list("http://........./updateJjtzDhj?dhj="+dhjStr+"&dm="+dm+"", 
    "diffgr:diffgram", "");}
    else if(lsjStr.length()!=0&&dhjStr.length()!=0){
    parser.xml2list("http://........./updateJjtz?lsj="+lsjStr+"&dhj="+dhjStr+"&dm="+dm+"", 
    "diffgr:diffgram", "");}
    }catch(Exception e){
    e.printStackTrace();
    }
    SystemClock.setCurrentTimeMillis(2000);
     List<String[]> list=getDataFromServer();
     //System.out.println("new thread 插入后的list:"+list!=null);
     if(list!=null){ 
     mHandler.sendEmptyMessage(CODE_OK);
     }
    }
    }.start();  
                }catch(Exception e){
                e.printStackTrace();
                }
                }
                
            });
            dialog.setNegativeButton("取消修改",new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int which) {
    }
    });
            dialog.show();
    }

    文章结束给大家分享下程序员的一些笑话语录: 与女友分手两月有余,精神萎靡,面带菜色。家人介绍一女孩,昨日与其相亲。女孩果然漂亮,一向吝啬的我决定破例请她吃晚饭。
    选了一个蛮贵的西餐厅,点了比较贵的菜。女孩眉开眼笑,与我谈得很投机。聊着聊着,她说:“我给你讲个笑话吧。”“ok”
      “一只螳螂要给一只雌蝴蝶介绍对象,见面时发现对方是只雄蜘蛛。见面后螳螂问蝴蝶‘如何?’,‘他长的太难看了’,‘别看人家长的丑,人家还有网站呢’。”
      “呵呵………”我笑。忽然她问:“你有网站吗?”  

    --------------------------------- 原创文章 By
    重写和修改
    ---------------------------------

  • 相关阅读:
    junit4
    spring
    hibernate 的注意事项
    Struts2 的 命名规范
    Struts2 的标签
    OGNL
    添加删除 板块 struts2
    Struts2 的各种xml 和struts 配置信息 都是一样的
    struts2
    struts2
  • 原文地址:https://www.cnblogs.com/jiangu66/p/3098151.html
Copyright © 2020-2023  润新知