效果图
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" > <include android:id="@+id/ptas_top_bar" layout="@layout/ptas_top_bar" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" android:orientation="vertical" > <include android:id="@+id/ptas_common_map" layout="@layout/common_map" /> <LinearLayout android:id="@+id/navigation_bar" android:layout_width="fill_parent" android:layout_height="55dip" android:layout_alignParentTop="true" android:background="@drawable/txt_msg_bg" android:orientation="horizontal" android:paddingRight="7.0dip" > <RelativeLayout android:id="@+id/main_app_nagv" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toLeftOf="@+id/main_app_nagv_btn" android:layout_weight="1.0" android:orientation="horizontal" > <AutoCompleteTextView android:id="@+id/main_app_nagv_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginBottom="5.0dip" android:layout_marginLeft="3.0dip" android:layout_marginRight="5.0dip" android:layout_marginTop="5.0dip" android:autoText="true" android:background="@drawable/sms_embeded_text_editor_bg" android:capitalize="sentences" android:focusable="true" android:hint="@string/navigation_textview_hint" android:imeOptions="actionSend|flagNoEnterAction" android:inputType="phone" android:maxLength="50" android:maxLines="1" android:minHeight="34.0dip" android:nextFocusRight="@+id/main_app_nagv_btn" android:textColorHint="@color/search_hint" /> <ImageView android:id="@+id/main_app_contact_sel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/main_app_nagv_text" android:layout_alignRight="@+id/main_app_nagv_text" android:layout_alignTop="@+id/main_app_nagv_text" android:layout_marginRight="1.0dip" android:background="@drawable/ptas_contact_select" /> </RelativeLayout> <Button android:id="@+id/main_app_nagv_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:background="@drawable/smsdetail_send_button_bg" android:gravity="center" android:paddingLeft="11.0dip" android:paddingRight="11.0dip" /> </LinearLayout> <LinearLayout android:id="@+id/contact_content_list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/navigation_bar" android:orientation="horizontal" android:paddingRight="7.0dip" android:visibility="gone" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="30dip" android:layout_toLeftOf="@+id/main_app_nagv_btn_1" android:layout_weight="1.0" android:orientation="vertical" > <TextView android:id="@+id/receiver_empty" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:textSize="25sp" android:visibility="gone" /> <ListView android:id="@+id/common_list_view" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1.0" android:cacheColorHint="#00000000" android:transcriptMode="normal" /> <com.wxlh.ptas.ui.rapid.RapidView android:id="@+id/letterList" android:layout_width="25dip" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:background="@drawable/scroller_bg" /> </RelativeLayout> <Button android:id="@+id/main_app_nagv_btn_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:background="@drawable/smsdetail_send_button_bg" android:gravity="center" android:paddingLeft="11.0dip" android:paddingRight="11.0dip" android:visibility="invisible" /> </LinearLayout> </RelativeLayout> </LinearLayout> </LinearLayout>
思路:让左边和右边都有一个Button,在ListView所在的Button上采用Invisible的形式,让布局不要变形
http://developer.apple.com/library/mac/#qa/qa1490/_index.html
A: Why do I get a runtime exception of "selector not recognized" when linking against an Objective-C static library that contains categories?
The "selector not recognized" runtime exception occurs due to an issue between the implementation of standard UNIX static libraries, the linker and the dynamic nature of Objective-C. Objective-C does not define linker symbols for each function (or method, in Objective-C) - instead, linker symbols are only generated for each class. If you extend a pre-existing class with categories, the linker does not know to associate the object code of the core class implementation and the category implementation. This prevents objects created in the resulting application from responding to a selector that is defined in the category.
To resolve this issue, the target linking against the static library must pass the -ObjC option to the linker. This flag causes the linker to load every object file in the library that defines an Objective-C class or category. While this option will typically result in a larger executable (due to additional object code loaded into the application), it will allow the successful creation of effective Objective-C static libraries that contain categories on existing classes. Follow these steps to pass -ObjC to the linker:
In Xcode, double-click the target's name under "Targets" in the Project window.
Choose the Build pane from the ensuing Info window.
Scroll down to the Other Linker Flags build setting under the Linking collection and set its value to -ObjC.
Important For 64-bit and iPhone OS applications, there is a linker bug that prevents -ObjC from loading objects files from static libraries that contain only categories and no classes. The workaround is to use the-all_load or -force_load flags.
-all_load forces the linker to load all object files from every archive it sees, even those without Objective-C code. -force_load is available in Xcode 3.2 and later. It allows finer grain control of archive loading. Each -force_load option must be followed by a path to an archive, and every object file in that archive will be loaded.
Document Revision History
Date Notes 2010-04-30
Describes how to pass the "-ObjC" option to the linker. Updated for Mac OS X v10.6 and later.
2006-10-03Changed "and" to "an" in order to make the content correct.
2006-09-25New document that describes how to properly build Objective-C static libraries that contain categories on existing classes.
链接超时:
多长时间内,无法建立Socket,中断链接。
读取超时:
http链接发送请求,读取对方的反馈,有时候会长时间读到不到对方的反馈。这个时间是设置多长时间读取不到对方的反馈,中断链接。