سؤال

أريد ضبط تذييل على الطبقة العليا من تطبيقي. لا ينبغي أن يكون له أي يهز وتحركات أثناء التنقل في النشاط أو إظهار لوحة المفاتيح. يجب أن تستقر دائمًا في أسفل الشاشة. كيف يتم فعل ذلك؟ أي أفكار بلز.

هل كانت مفيدة؟

المحلول

قد يكون ذلك giveacodicetagpre. يجب أن يكون

giveacodicetagpre.

أنت تحاول إضافة نفس الموقت بالضبط لكل تعريف مهمة في تطبيق الويب؛)

نصائح أخرى

الفرق هو أن النشاط يرى ذلك أنه يجب أن ينتهي الأمر من التنفيذ أولا قبل "تدمير" العرض، في حين أن OnStop عبارة عن مرحلة دورة حياة متتالية بعد العرض موجود بالفعل في الخلفية - وهذا يعني أن النشاط غير مرئي بعد الآن.

القيام بالأشياء داخل OnPause يتأكد من أن العناصر التي تحتاجها لحفظها لا تزال سليمة قبل السماح لها - على سبيل المثال، تحتاج إلى حفظ النص في Edittext الخاص بك، أو موضع تشغيل / إيقاف تشغيل Radiobuttons، إلخ.

الكتب غير بحاجة إلى أي من هذه الأشياء بعد الآن، لذلك يجب أن تكون على ما يرام إذا قمت بذلك في OnStop

تستطيع فعل ذلك. حاولت ذلك وعملها .. لوحة المفاتيح تخفي تذييل ..

أنا هنا ألصق مقتطف الكود الخاص بي ..

 <RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">    
<LinearLayout android:layout_width="fill_parent"
    android:orientation="vertical" android:layout_below="@+id/top_layout"
    android:id="@+id/control_layout" android:layout_height="fill_parent"
    android:layout_centerVertical="true" android:layout_centerHorizontal="true"
    android:background="@drawable/bg" android:fadingEdge="horizontal|vertical"
    android:fitsSystemWindows="true">
    <EditText android:layout_width="wrap_content"
        android:textStyle="normal" android:typeface="serif"
        android:imeOptions="actionDone|flagNoEnterAction" android:textSize="14sp"
        android:text="Enter TExt here"
        android:isScrollContainer="true" android:scrollHorizontally="false"
        android:layout_height="fill_parent" android:layout_marginBottom="45dip"
        android:scrollbarStyle="insideInset" android:id="@+id/edit_text"
        android:background="@android:color/transparent" android:gravity="top"
        android:paddingBottom="1dip" android:paddingLeft="2dip"
        android:paddingRight="1dip" android:paddingTop="1dip" android:visibility="visible"></EditText>
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
    android:orientation="vertical" android:id="@+id/main_layout"
    android:gravity="bottom" android:isScrollContainer="true"
    android:layout_height="wrap_content" android:layout_alignParentBottom="true">
    <LinearLayout android:id="@+id/bottom_panel"
        android:layout_height="wrap_content" android:orientation="horizontal"
        android:layout_width="fill_parent" android:background="@drawable/bottom_panel_bg">
        <Button android:layout_width="wrap_content" android:text="Explore"
            android:background="@drawable/explore" android:layout_gravity="center_vertical"
            android:id="@+id/explore_text" android:textColor="#FFFFFF"
            android:gravity="bottom" android:paddingRight="1dip"
            android:layout_height="fill_parent" android:textColorHighlight="#FFFFA6"
            android:typeface="serif" android:layout_marginLeft="5dip"></Button>
        <Button android:layout_width="wrap_content" android:id="@+id/search_text"
            android:background="@drawable/btn_search" android:gravity="bottom"
            android:text="Search" android:textColor="#FFFFFF"
            android:layout_height="fill_parent" android:typeface="serif"
            android:layout_marginLeft="11dip"></Button>
        <Button android:layout_width="wrap_content" android:id="@+id/fav_text"
            android:text="Favorite" android:background="@drawable/favorites_text"
            android:gravity="bottom" android:textColor="#FFFFFF"
            android:layout_height="fill_parent" android:typeface="serif"
            android:layout_marginLeft="10dip"></Button>
        <Button android:layout_width="wrap_content" android:text="My Data"
            android:id="@+id/my_text" android:background="@drawable/my_texts"
            android:gravity="bottom" android:textColor="#FFFFFF"
            android:layout_height="fill_parent" android:typeface="serif"
            android:layout_marginLeft="11dip"></Button>
        <Button android:id="@+id/about_us" android:background="@drawable/about_us"
            android:gravity="bottom" android:textColor="#FFFFFF"
            android:layout_gravity="center_horizontal" android:text="About"
            android:layout_height="fill_parent" android:textColorHighlight="#FFFFA6"
            android:layout_width="wrap_content" android:typeface="serif"
            android:layout_marginLeft="11dip"></Button>
    </LinearLayout>
</LinearLayout>

تحقق مما إذا كان يساعدك أم لا

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top