u011371270
漆黑天使复活
采纳率57.5%
2016-05-14 04:01 阅读 3.2k

android textview内容消失问题

150

我做了一个简单的fragment界面,主要是输入ID,然后向服务器查询内容后赋值回原来的界面上的textview,但是在运行的时候发生了一个奇怪的问题,一部分的textview消失了,具体很难描述,以下是整个过程的描述
图片说明
这是个原始界面,在最上方输入编号,然后查询。
图片说明
点击查询后,可以看见,背景内容已经加载,textview的内容已经进去了,但是加载完成后,textview
图片说明
如上图,加载完成后,下面的Textview不见了,而且,连那些实现写好的静态的textview也不见了
然后,我通过弹出输入法,用输入法覆盖部分内容
图片说明
像上图这样,在搜索框中点击之后,输入法会自动弹出,覆盖掉下面的内容,然后再取消
图片说明
然后内容就出来了。。。

每次都是这个样子。。我觉得很奇怪,不知道什么原因导致的,谁能帮忙看看吗?谢谢

整个框架大框架是fragment+viewpage,查询用的AsyncTask查询后赋值。

上代码了,布局文件,是一个fragment_content,xml

 <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

<LinearLayout
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <EditText
        android:layout_width="270dip"
        android:layout_height="52dip"
        android:id="@+id/searchText"
        android:hint="请输入客户编号ID或扫二维码"
        android:background="@android:drawable/editbox_background_normal"/>
    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/ic_menu_search"
        android:id="@+id/search_button"/>
    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/ic_menu_camera"
        android:id="@+id/search_QRcode"/>
</LinearLayout>
<LinearLayout
    android:layout_marginTop="5dip"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:background="#F2F3EB">
    <TextView
        android:layout_width="360dip"
        android:layout_height="35dip"
        android:text="业主信息"
        android:gravity="center"
        android:layout_gravity="center"
        android:layout_marginTop="8dip"
        android:background="@android:drawable/btn_default"
        />
    <LinearLayout
        android:layout_marginTop="8dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="业主名称"/>
        <TextView
            android:id="@+id/CustomerNAME"
            android:layout_width="300dip"
            android:layout_height="wrap_content"
            android:text="请输入客户ID"
            android:gravity="center"/>
    </LinearLayout>
    <LinearLayout
        android:layout_marginTop="8dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="行业性质"/>
        <TextView
            android:layout_width="300dip"
            android:layout_height="wrap_content"

            android:gravity="center"
            android:id="@+id/CustomerSegment"/>
    </LinearLayout>
    <LinearLayout
        android:layout_marginTop="8dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="联系地址"/>
        <TextView
            android:layout_width="300dip"
            android:layout_height="wrap_content"
            android:id="@+id/CustomerAddress"
            android:gravity="center"/>
    </LinearLayout>
    <LinearLayout
        android:layout_marginTop="8dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="联系人"/>
        <TextView
            android:layout_width="300dip"
            android:layout_height="wrap_content"
            android:id="@+id/CustomerContactor"
            android:gravity="center"/>
    </LinearLayout>
    <LinearLayout
        android:layout_marginTop="8dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
        <TextView
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="联系电话"/>
        <TextView
            android:layout_width="300dip"
            android:layout_height="wrap_content"
            android:id="@+id/CustomerPhone"
            android:gravity="center"/>
    </LinearLayout>
    <LinearLayout
        android:layout_marginLeft="4dip"
        android:layout_marginTop="8dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_marginBottom="5dip">
        <TextView
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="保养合约到期时间"/>
        <TextView
            android:layout_width="300dip"
            android:layout_height="wrap_content"
            android:id="@+id/Customercontactdate"
            android:gravity="center"/>
    </LinearLayout>
//下面开始就是出问题的部分布局
</LinearLayout>
    <LinearLayout
        android:layout_marginTop="10dip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="#F2F3EB">
        <TextView
            android:layout_width="360dip"
            android:layout_height="35dip"
            android:text="维护人员信息"
            android:gravity="center"
            android:layout_gravity="center"
            android:layout_marginTop="8dip"
            android:background="@android:drawable/btn_default"
            />
        <TextView
            android:layout_width="400dip"
            android:layout_height="30dip"
            android:text="专属客户代表"
            android:gravity="center" />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginBottom="10dip">

                <ImageView
                    android:layout_width="120dip"
                    android:layout_height="100dip"
                    android:src="@drawable/unknownpic"
                    android:id="@+id/SRPIC"/>

            <TableLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                >

            <TableRow
                android:layout_marginTop="7dip">
                <TextView
                    android:layout_width="70dip"
                    android:layout_height="wrap_content"
                    android:text="姓名"
                    android:gravity="center"/>
                <TextView
                    android:layout_width="220dip"
                    android:layout_height="match_parent"
                    android:id="@+id/ServiceRepresentive"
                    android:gravity="center"/>
            </TableRow>
                <TableRow
                    android:layout_marginTop="7dip">
                    <TextView
                        android:layout_width="70dip"
                        android:layout_height="wrap_content"
                        android:text="职位"
                        android:gravity="center"/>
                    <TextView
                        android:layout_width="220dip"
                        android:layout_height="match_parent"
                        android:id="@+id/SRP"
                        android:gravity="center"/>
                </TableRow>
                <TableRow
                    android:layout_marginTop="7dip">
                    <TextView
                        android:layout_width="70dip"
                        android:layout_height="wrap_content"
                        android:text="联系方式"
                        android:gravity="center"/>
                    <TextView
                        android:layout_width="220dip"
                        android:layout_height="match_parent"
                        android:id="@+id/SRN"
                        android:gravity="center"/>
                </TableRow>
                <TableRow
                    android:layout_marginTop="7dip">
                    <TextView
                        android:layout_width="70dip"
                        android:layout_height="wrap_content"
                        android:text="工作年限"
                        android:gravity="center"/>
                    <TextView
                        android:layout_width="220dip"
                        android:layout_height="match_parent"
                        android:id="@+id/SRY"
                        android:gravity="center"/>
                </TableRow>
            </TableLayout>

        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <TextView
                android:layout_width="400dip"
                android:layout_height="30dip"
                android:text="专属服务技师"
                android:gravity="center" />
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_marginBottom="10dip">

                <ImageView
                    android:layout_width="120dip"
                    android:layout_height="100dip"
                    android:src="@drawable/unknownpic"
                    android:id="@+id/STPIC"/>

                <TableLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    >

                    <TableRow
                        android:layout_marginTop="7dip">
                        <TextView
                            android:layout_width="70dip"
                            android:layout_height="wrap_content"
                            android:text="姓名"
                            android:gravity="center"/>
                        <TextView
                            android:layout_width="220dip"
                            android:layout_height="match_parent"
                            android:id="@+id/ServiceTechnician"
                            android:gravity="center"/>
                    </TableRow>
                    <TableRow
                        android:layout_marginTop="7dip">
                        <TextView
                            android:layout_width="70dip"
                            android:layout_height="wrap_content"
                            android:text="职位"
                            android:gravity="center"/>
                        <TextView
                            android:layout_width="220dip"
                            android:layout_height="match_parent"
                            android:id="@+id/STN"
                            android:gravity="center"/>
                    </TableRow>

                    <TableRow
                        android:layout_marginTop="7dip">
                        <TextView
                            android:layout_width="70dip"
                            android:layout_height="wrap_content"
                            android:text="工作年限"
                            android:gravity="center"/>
                        <TextView
                            android:layout_width="220dip"
                            android:layout_height="match_parent"
                            android:id="@+id/STY"
                            android:gravity="center"/>
                    </TableRow>
                    <TableRow
                        android:layout_marginTop="7dip">
                        <TextView
                            android:layout_width="70dip"
                            android:layout_height="wrap_content"
                            android:text="专业技能"
                            android:gravity="center"/>
                        <TextView
                            android:layout_width="220dip"
                            android:layout_height="match_parent"
                            android:id="@+id/STS"
                            android:gravity="center"/>
                    </TableRow>
                </TableLayout>

            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
</ScrollView>

fragment的文件,里面除了查询,还有一个二维码扫描

 public class CustomerInf extends Fragment {
    ImageButton search,search_QRcode;
    EditText editText;
    String searchID;
    TextView CustomerName,CustomerSegment,CustomerAddress,CustomerContactor,CustomerPhone;
    TextView Customercontactdate,ServiceRepresentive,SRP,SRN,SRY,ServiceTechnician,STN,STY,STS;
    ImageView SRPIC,STPIC;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_content, container, false);
        bind(view);
        return view;

    }
//对各内容进行绑定
    public void bind(View view) {
        search = (ImageButton) view.findViewById(R.id.search_button);
        editText = (EditText) view.findViewById(R.id.searchText);
        CustomerName=(TextView)view.findViewById(R.id.CustomerNAME);
        CustomerSegment=(TextView)view.findViewById(R.id.CustomerSegment);
        CustomerAddress=(TextView)view.findViewById(R.id.CustomerAddress);
        CustomerContactor=(TextView)view.findViewById(R.id.CustomerContactor);
        CustomerPhone=(TextView)view.findViewById(R.id.CustomerPhone);
        Customercontactdate=(TextView)view.findViewById(R.id.Customercontactdate);
        ServiceRepresentive=(TextView)view.findViewById(R.id.ServiceRepresentive);
        SRP=(TextView)view.findViewById(R.id.SRP);
        SRN=(TextView)view.findViewById(R.id.SRN);
        SRY=(TextView)view.findViewById(R.id.SRY);
        ServiceTechnician=(TextView)view.findViewById(R.id.ServiceTechnician);
        STN=(TextView)view.findViewById(R.id.STN);
        STY=(TextView)view.findViewById(R.id.STY);
        STS=(TextView)view.findViewById(R.id.STS);
        SRPIC=(ImageView) view.findViewById(R.id.SRPIC);
        STPIC=(ImageView) view.findViewById(R.id.STPIC);
        search.setOnClickListener(new Click());
        search_QRcode=(ImageButton)view.findViewById(R.id.search_QRcode);
        search_QRcode.setOnClickListener(new QRsearch());
    }

        //此处是一个引用外部二维码扫描的程序
    public class QRsearch implements View.OnClickListener{
        @Override
        public void onClick(View v){
            if (ContextCompat.checkSelfPermission(getContext(),
                    Manifest.permission.CAMERA)
                    != PackageManager.PERMISSION_GRANTED) {

                if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(),
                        Manifest.permission.CAMERA)) {



                } else {



                    requestPermissions(
                            new String[]{Manifest.permission.CAMERA},
                            123);


                }
            } else {
                Toast.makeText(getContext(),"开始扫描",Toast.LENGTH_SHORT).show();
                Intent startScan=new Intent(getContext(), CaptureActivity.class);
                startActivityForResult(startScan, Activity.RESULT_FIRST_USER);
            }

        }

    }

        //二维码的返回
    @Override
    public void onActivityResult(int requestCode,int resultCode,Intent data){
        super.onActivityResult(requestCode,resultCode,data);
        if(resultCode==Activity.RESULT_OK){
            Bundle bundle = data.getExtras();
            String scanResult = bundle.getString("result");
            editText.setText(scanResult);
            searchID = editText.getText().toString().trim();
            if (TextUtils.isEmpty(searchID)) {
                Toast.makeText(getActivity(), "请输入客户ID"+searchID, Toast.LENGTH_LONG).show();
            } else {
                SearchTask searchTask = new SearchTask();
                String[] array=new String[]{"http://www.klmt001.com/CustomerINF.php",searchID};
                searchTask.execute(array);
            }
        }
    }
        //这里是查询按钮的监听器
    public class Click implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            searchID = editText.getText().toString().trim();
            if (TextUtils.isEmpty(searchID)) {
                Toast.makeText(getActivity(), "请输入客户ID"+searchID, Toast.LENGTH_LONG).show();
            } else {
                SearchTask searchTask = new SearchTask();
                String[] array=new String[]{"http://www.klmt001.com/CustomerINF.php",searchID};
                searchTask.execute(array);
            }

        }
    }
//监听按钮的AsyncTask
    class SearchTask extends AsyncTask<String, Integer, JSONObject> {
ProgressDialog p1;

        @Override
        protected void onPreExecute() {
            p1=new ProgressDialog(getActivity());
            p1.setTitle("请等待");
            p1.setMessage("等待中........");
           p1.setCancelable(false);
            p1.show();
          new Handler().postDelayed(new Runnable(){

                public void run() {

                   p1.dismiss();

                }

            }, 1000);

        }

        protected JSONObject doInBackground(String... inf) {
            HttpClient httpclient = new DefaultHttpClient();
            HttpEntity entity = null;

            StringBuilder builder = new StringBuilder();

            JSONObject jsonObject=null;
            try {
                HttpPost httpPost = new HttpPost(inf[0]);
                List<NameValuePair> list = new ArrayList<>();
                list.add(new BasicNameValuePair("CustomerID", inf[1]));
                httpPost.setEntity(new UrlEncodedFormEntity(list, HTTP.UTF_8));
                HttpResponse response = httpclient.execute(httpPost);
                entity = response.getEntity();
                if (response.getEntity() != null) {
                    if (response.getEntity().toString().equals("0")) {
                        jsonObject=null;
                        Log.v("msg",""+"没有收到信息");
                    } else {
                        BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
                        String s = reader.readLine();
                        for (; s != null; s = reader.readLine()) {
                            builder.append(s);
                        }
                        Log.v("msg",""+"成功获取信息");
                        jsonObject = new JSONObject(builder.toString());
                    }
                }
            } catch (Exception E) {
                Log.e("msg", E.getMessage());
                Log.v("msg",
                        "没有成功 ");
            } finally {
                try {
                    if (entity != null) {
//                  entity.consumeContent();//强制释放资源
                        httpclient.getConnectionManager().shutdown();//关闭连接
                        //这两种释放连接的方法都可以
                    }
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

            }
            return jsonObject;
        }
//获取值之后开始对原来的textview进行赋值
        protected void onPostExecute(JSONObject webcontent){

            String cn,cs,ca,cc,cp,cd,sr,srd,srn,sry,st,stn,sty,sts,pic1,pic2;

            if(webcontent==null){
                Toast.makeText(getActivity(),"没有对应的客户信息",Toast.LENGTH_LONG).show();
            }else {
               try {
                   cn=webcontent.getString("CustomerName");
                   CustomerName.setText(cn);
                   cs=webcontent.getString("CustomerSegment");
                   CustomerSegment.setText(cs);
                   ca=webcontent.getString("CustomerAddress");
                   CustomerAddress.setText(ca);
                   cc=webcontent.getString("CustomerContactor");
                   CustomerContactor.setText(cc);
                   cp=webcontent.getString("CustomerPhone");
                   CustomerPhone.setText(cp);
                   cd=webcontent.getString("Customercontactdate");
                   Customercontactdate.setText(cd);
                   sr=webcontent.getString("ServiceRepresentive");
                   ServiceRepresentive.setText(sr);
                   srd=webcontent.getString("SRP");
                   SRP.setText(srd);
                   srn=webcontent.getString("SRN");
                   SRN.setText(srn);
                   sry=webcontent.getString("SRY");
                   SRY.setText(sry);
                   st=webcontent.getString("ServiceTechnician");
                   ServiceTechnician.setText(st);
                   stn=webcontent.getString("STN");
                   STN.setText(stn);
                   sty=webcontent.getString("STY");
                   STY.setText(sty);
                   sts=webcontent.getString("STS");
                   STS.setText(sts);
                   pic1=webcontent.getString("SRPIC");
                   pic2=webcontent.getString("STPIC");
                   String[] pics=new String[]{pic1,pic2};
                   Loadpics loadpics=new Loadpics();
                   loadpics.execute(pics);
               }catch (Exception E){
                   E.printStackTrace();
               }

            }

        }


    }
        //这里是用来获取图片的
    class Loadpics extends AsyncTask<String, Integer, Bitmap[]>{
        protected Bitmap[] doInBackground(String... inf) {
            Bitmap[] bitmaps=new Bitmap[2];
            Bitmap bitmap1,bitmap2;
            try{
                URL url1=new URL(inf[0]);
                URLConnection conn1=url1.openConnection();
                conn1.connect();
                InputStream inputStream = conn1.getInputStream();
                bitmap1 = BitmapFactory.decodeStream(inputStream);
                URL url2=new URL(inf[1]);
                URLConnection conn2=url2.openConnection();
                conn2.connect();
                InputStream inputStream2 = conn2.getInputStream();
                bitmap2 = BitmapFactory.decodeStream(inputStream2);
                bitmaps[0]=bitmap1;
                bitmaps[1]=bitmap2;
            }catch (Exception E){
                Log.e("msg", E.getMessage());
            }return bitmaps;

        }
        protected void onPostExecute(Bitmap[] bitmap){
            try{
                SRPIC.setImageBitmap(bitmap[0]);
                STPIC.setImageBitmap(bitmap[1]);
            }catch (Exception E){
                Log.e("msg", E.getMessage());
        }
    }

}}
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • shenshucong520 glustful 2016-05-14 04:08

    应该是你代码有问题,没代码也看不出什么东西来,上代码吧

    点赞 评论 复制链接分享
  • l_vaule l_vaule 2016-05-14 04:47

    最好能看看代码,感觉这类问题很多时候都是由于自己不小心造成的。。。

    点赞 评论 复制链接分享
  • lbcab lbcab 2016-05-14 05:52

    还是应该从代码里看, 不然光从现象很难确定问题所在

    点赞 评论 复制链接分享
  • franzhong franzhong 2016-05-14 07:16

    不是界面未“刷新”,就是界面被输入法推出布局了 - 从这两个点去查原因。
    (首先通过Log排除数据的延迟或是空数据问题。)

    点赞 评论 复制链接分享
  • yangjiabei_0301 临时工华北区的 2016-05-25 11:03

    我看了一下你写的布局文件,你用的TableLayout和TableRow来设计的,我看到你说有问题的地方在有半部分,你的有半部分的textview好几个的android:layout_height="match_parent"你这样肯定有问题,你可以调一下实时,我不太熟悉你用到的tablerow,我用LinearLayout和layout_weight属性也布了一个和你一样的页面你可以看看,如果你必须用到tablerow,你可以看看这个网址 http://www.cnblogs.com/tinyphp/p/3812486.html ,我看你里面的textview的好几个布局都已经超出屏幕了,你自己再调调,应该没有什么大问题,不要去随便指定layout_width为一个固定的值,你指定的话可能自己的手机吗没有问题,但是在其他的手机上可能有问题,我把我写的代码贴在下面:

    <?xml version="1.0" encoding="utf-8"?>
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <!--top-->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
    
            <EditText
                android:id="@+id/searchText"
                android:layout_width="270dip"
                android:layout_height="52dip"
                android:background="@android:drawable/editbox_background_normal"
                android:hint="请输入客户编号ID或扫二维码" />
    
            <ImageButton
                android:id="@+id/search_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@android:drawable/ic_menu_search" />
    
            <ImageButton
                android:id="@+id/search_QRcode"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@android:drawable/ic_menu_camera" />
        </LinearLayout>
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dip"
            android:background="#F2F3EB"
            android:orientation="vertical">
    
            <TextView
                android:layout_width="match_parent"
                android:layout_height="35dip"
                android:layout_gravity="center"
                android:layout_marginTop="8dip"
                android:background="@android:drawable/btn_default"
                android:gravity="center"
                android:text="业主信息" />
            <!--业主信息模块-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dip"
                android:orientation="vertical"
                android:paddingBottom="10dp">
    
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal">
                    <!--左边-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="2"
                        android:divider="@drawable/spacer_medium"
                        android:gravity="center_horizontal"
                        android:orientation="vertical"
                        android:showDividers="middle">
    
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="业主名称" />
    
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="行业性质" />
    
                        <TextView
                            android:layout_width="100dip"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="联系地址" />
    
                        <TextView
                            android:layout_width="100dip"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="联系人" />
    
                        <TextView
                            android:layout_width="100dip"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="联系电话" />
    
                        <TextView
                            android:layout_width="100dip"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="保养合约到期时间" />
    
                    </LinearLayout>
                    <!--右边-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:gravity="center_horizontal"
                        android:orientation="vertical"
                        android:divider="@drawable/spacer_medium"
                        android:showDividers="middle"
                        >
    
                        <TextView
                            android:id="@+id/CustomerNAME"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="请输入客户ID" />
    
                        <TextView
                            android:id="@+id/CustomerSegment"
                            android:layout_width="300dip"
                            android:layout_height="wrap_content"
                            android:gravity="center" />
    
                        <TextView
                            android:id="@+id/CustomerAddress"
                            android:layout_width="300dip"
                            android:layout_height="wrap_content"
                            android:gravity="center" />
    
                        <TextView
                            android:id="@+id/CustomerContactor"
                            android:layout_width="300dip"
                            android:layout_height="wrap_content"
                            android:gravity="center" />
    
                        <TextView
                            android:id="@+id/CustomerPhone"
                            android:layout_width="300dip"
                            android:layout_height="wrap_content"
                            android:gravity="center" />
    
                        <TextView
                            android:id="@+id/Customercontactdate"
                            android:layout_width="300dip"
                            android:layout_height="wrap_content"
                            android:gravity="center" />
    
                    </LinearLayout>
    
                </LinearLayout>
    
    
            </LinearLayout>
    
    
        </LinearLayout>
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:background="#F2F3EB"
            android:orientation="vertical">
    
            <TextView
                android:layout_width="360dip"
                android:layout_height="35dip"
                android:layout_gravity="center"
                android:layout_marginTop="8dip"
                android:background="@android:drawable/btn_default"
                android:gravity="center"
                android:text="维护人员信息" />
    
            <TextView
                android:layout_width="match_parent"
                android:layout_height="30dip"
                android:gravity="center"
                android:text="专属客户代表" />
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dip"
                android:orientation="horizontal">
    
                <ImageView
                    android:id="@+id/SRPIC"
                    android:layout_width="120dip"
                    android:layout_height="100dip"
                    android:src="@drawable/ic_launcher" />
    
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dip"
                    android:orientation="vertical"
                    android:paddingBottom="10dp">
    
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="horizontal">
                        <!--左边-->
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="2"
                            android:divider="@drawable/spacer_medium"
                            android:gravity="center_horizontal"
                            android:orientation="vertical"
                            android:showDividers="middle">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:text="姓名" />
    
                            <TextView
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:text="职位" />
    
                            <TextView
                                android:layout_width="100dip"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:text="联系方式" />
    
                            <TextView
                                android:layout_width="100dip"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:text="工作年限" />
    
    
                        </LinearLayout>
                        <!--右边-->
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center_horizontal"
                            android:orientation="vertical"
                            android:divider="@drawable/spacer_medium"
                            android:showDividers="middle"
                            >
                            <TextView
                                android:id="@+id/ServiceRepresentive"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:text="0000000" />
    
                            <TextView
                                android:id="@+id/SRP"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:gravity="center" />
    
                            <TextView
                                android:id="@+id/SRN"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:gravity="center" />
    
                            <TextView
                                android:id="@+id/SRY"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:gravity="center" />
    
                        </LinearLayout>
    
                    </LinearLayout>
    
    
                </LinearLayout>
    
            </LinearLayout>
    
        </LinearLayout>
    </LinearLayout>
    

    这个是我的布局图,下面一个差不多就不写了,你自己看看,希望采纳!我急缺C币去下载文件!

    图片说明

    点赞 评论 复制链接分享

相关推荐