整合營銷服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費(fèi)咨詢熱線:

          1.2.2.7-表單制作-表單布局對(duì)齊設(shè)置

          AP應(yīng)用定制之表單設(shè)計(jì)。

          大家好,現(xiàn)在學(xué)習(xí)一下表單是布局對(duì)齊的操作設(shè)置?,F(xiàn)在打開表單樣式,如果選中一個(gè)單元格之后,在表單設(shè)計(jì)上方會(huì)出現(xiàn)六個(gè)對(duì)齊操作按鈕。

          ·前面三個(gè)是左對(duì)齊、居中對(duì)齊、右對(duì)齊,它是控制單元格內(nèi)的內(nèi)容、字段標(biāo)題或者是空鍵內(nèi)容水平方向?qū)R控制顯示。

          ·后面三個(gè)是控制垂直方向的控制顯示,可以頂部對(duì)齊、居中對(duì)齊、底部對(duì)齊。

          可以根據(jù)操作顯示單元格以及表單樣式自行選擇是靠左、靠右、靠頂還是靠下。一般表單字段標(biāo)題都是建議靠右對(duì)起來顯示,這樣會(huì)顯得整體對(duì)齊感。四段空間如果沒有特殊要求,一般保持默認(rèn)是左對(duì)齊即可。

          其他的像一些裝飾的公司名稱、表單名稱這些一些顯示,單據(jù)內(nèi)容主題特點(diǎn)的也是芬蘭名稱,可以根據(jù)整體的樣式感來控制是靠左、靠右還是靠頂。

          這個(gè)就是表單布局對(duì)齊的操作設(shè)置,謝謝。

          介:在編輯doc文檔的過程中,有時(shí)候行點(diǎn)擊居中按鈕,好像并不居中,這是什么原因呢?下面給大家簡單的介紹一下。

          工具:wps文字

          原因一、段落的首行縮進(jìn)了兩格

          方法:拖動(dòng)標(biāo)尺把首行頂格對(duì)齊或用退格鍵

          原因二、段落中有空格

          方法:刪除空格

          第一步:點(diǎn)擊顯示段落標(biāo)記按鈕

          第二步:選中空格,按退格鍵刪除

          注:也可以全部清除格式,重新排版。

          、聲明控件

          1、如果你打開Android Studio后沒有自動(dòng)打開上一次創(chuàng)建的項(xiàng)目(比如我上次創(chuàng)建的是MyFirst App),看到的是圖1所示的歡迎界面,直接找到項(xiàng)目點(diǎn)擊打開即可


          圖1

          2、打開后如圖2,默認(rèn)展示的是MainActivity.java,我們切換到activity_main.xml中,可以按住ctrl鍵(Mac系統(tǒng)是Command鍵),然后鼠標(biāo)單擊第12行的“activity_main”;也可以通過左側(cè)導(dǎo)航欄 res->layout->activity_main.xml雙擊打開


          圖2

          3、切換后如圖3,先看右上方框起來的部分,Android Studio布局支持三種設(shè)計(jì)模式,純視圖(就是現(xiàn)在看到這種)、視圖+代碼、純代碼,在純視圖模式下,我們可以直接從右側(cè)控件區(qū)拖動(dòng)控件到頁面,可以實(shí)時(shí)的、直觀的看到效果,通過拖動(dòng)調(diào)整間距和位置,個(gè)人其實(shí)更喜歡split模式,即視圖+代碼,在通過代碼添加控件的同時(shí)也能實(shí)時(shí)看到效果,我們點(diǎn)擊split切換到視圖+代碼模式


          圖3

          4、好,在圖4中,粗糙的講一下,這里系統(tǒng)默認(rèn)的約束布局(ConstraintLayout),個(gè)人習(xí)慣使用線性布局(LinearLayout)和相對(duì)布局(RelativeLayout),等我改一下


          圖4

          5、改動(dòng)后的代碼如下,

          <?xml version="1.0" encoding="utf-8"?>
          <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              tools:context=".MainActivity"
              android:gravity="center"
              android:orientation="vertical">
              <TextView
                  android:id="@+id/tv_text"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" 
                  android:text="Hello Word"
                  android:textSize="22sp"/>
              <Button
                  android:id="@+id/btn_change"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Click Me"/>
          
          </LinearLayout>
          • 根結(jié)點(diǎn)下,我添加了“android:orientation="vertical"”,表示垂直方向布局,不添加這一句默認(rèn)水平方向布局,即“android:orientation="horizontal"”
          • 根結(jié)點(diǎn)下,添加了“android:gravity="center"”,表示布局中的控件居中
          • 為TextView添加了id,并刪除了末尾四個(gè)屬性,因?yàn)槟撬膫€(gè)屬性在約束布局下才生效
          • 為TextView設(shè)置了默認(rèn)顯示文本和字體大小
          • 添加了Button控件并設(shè)置了id

          二、綁定控件

          接下來我們切換回MainActivity.java,然后定義和綁定好控件

          public class MainActivity extends AppCompatActivity {
          
              private TextView tvText;
              private Button btnChange;
              @Override
              protected void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.activity_main);
                  initView();
              }
          
              private void initView() {
                  tvText=findViewById(R.id.tv_text);
                  btnChange=findViewById(R.id.btn_change);
              }
          }

          這里我定義了一個(gè)initView方法,并在方法體內(nèi)進(jìn)行的控件綁定;一是編碼習(xí)慣,二是為了避免onCreate方法內(nèi)看起來太雜太亂

          三、通過點(diǎn)擊按鈕改變控件的顯示文本

          同理,添加setListener方法,設(shè)置btnChange的點(diǎn)擊事件

          private void setListener() {
              btnChange.setOnClickListener((v)->{
                  tvText.setText("我是點(diǎn)擊后的文本");
              });
          }

          別忘了在onCreate()方法里調(diào)用,即在“initView();”后添加“setListener();”;

          四、TextView的其它屬性

          俗話說,我可以不用,但你必須得有,這不,TextView支持的屬性我理解該有的它都有了,官網(wǎng)對(duì)于TextView屬性介紹如下:


          android:allowUndo

          Whether undo should be allowed for editable text.

          android:autoLink

          Controls whether links such as urls and email addresses are automatically found and converted to clickable links.

          android:autoSizeMaxTextSize

          The maximum text size constraint to be used when auto-sizing text.

          android:autoSizeMinTextSize

          The minimum text size constraint to be used when auto-sizing text.

          android:autoSizePresetSizes

          Resource array of dimensions to be used in conjunction with autoSizeTextType set to uniform.

          android:autoSizeStepGranularity

          Specify the auto-size step size if autoSizeTextType is set to uniform.

          android:autoSizeTextType

          Specify the type of auto-size.

          android:autoText

          If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors.

          android:breakStrategy

          Break strategy (control over paragraph layout).

          android:bufferType

          Determines the minimum type that getText() will return.

          android:capitalize

          If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types.

          android:cursorVisible

          Makes the cursor visible (the default) or invisible.

          android:digits

          If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept.

          android:drawableBottom

          The drawable to be drawn below the text.

          android:drawableEnd

          The drawable to be drawn to the end of the text.

          android:drawableLeft

          The drawable to be drawn to the left of the text.

          android:drawablePadding

          The padding between the drawables and the text.

          android:drawableRight

          The drawable to be drawn to the right of the text.

          android:drawableStart

          The drawable to be drawn to the start of the text.

          android:drawableTint

          Tint to apply to the compound (left, top, etc.) drawables.

          android:drawableTintMode

          Blending mode used to apply the compound (left, top, etc.) drawables tint.

          android:drawableTop

          The drawable to be drawn above the text.

          android:editable

          If set, specifies that this TextView has an input method.

          android:editorExtras

          Reference to an <input-extras> XML resource containing additional data to supply to an input method, which is private to the implementation of the input method.

          android:elegantTextHeight

          Elegant text height, especially for less compacted complex script text.

          android:ellipsize

          If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle.

          android:ems

          Makes the TextView be exactly this many ems wide.

          android:enabled

          Specifies whether the widget is enabled.

          android:fallbackLineSpacing

          Whether to respect the ascent and descent of the fallback fonts that are used in displaying the text.

          android:firstBaselineToTopHeight

          Distance from the top of the TextView to the first text baseline.

          android:fontFamily

          Font family (named by string or as a font resource reference) for the text.

          android:fontFeatureSettings

          Font feature settings.

          android:fontVariationSettings

          Font variation settings.

          android:freezesText

          If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position.

          android:gravity

          Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view.

          android:height

          Makes the TextView be exactly this tall.

          android:hint

          Hint text to display when the text is empty.

          android:hyphenationFrequency

          Frequency of automatic hyphenation.

          android:imeActionId

          Supply a value for EditorInfo.actionId used when an input method is connected to the text view.

          android:imeActionLabel

          Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view.

          android:imeOptions

          Additional features you can enable in an IME associated with an editor to improve the integration with your application.

          android:includeFontPadding

          Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly.

          android:inputMethod

          If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name).

          android:inputType

          The type of data being placed in a text field, used to help an input method decide how to let the user enter text.

          android:justificationMode

          Mode for justification.

          android:lastBaselineToBottomHeight

          Distance from the bottom of the TextView to the last text baseline.

          android:letterSpacing

          Text letter-spacing.

          android:lineBreakStyle

          Indicates the line break strategies can be used when calculating the text wrapping.

          android:lineBreakWordStyle

          Specify the phrase-based line break can be used when calculating the text wrapping.

          android:lineHeight

          Explicit height between lines of text.

          android:lineSpacingExtra

          Extra spacing between lines of text.

          android:lineSpacingMultiplier

          Extra spacing between lines of text, as a multiplier.

          android:lines

          Makes the TextView be exactly this many lines tall.

          android:linksClickable

          If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found.

          android:marqueeRepeatLimit

          The number of times to repeat the marquee animation.

          android:maxEms

          Makes the TextView be at most this many ems wide.

          android:maxHeight

          Makes the TextView be at most this many pixels tall.

          android:maxLength

          Set an input filter to constrain the text length to the specified number.

          android:maxLines

          Makes the TextView be at most this many lines tall.

          android:maxWidth

          Makes the TextView be at most this many pixels wide.

          android:minEms

          Makes the TextView be at least this many ems wide.

          android:minHeight

          Makes the TextView be at least this many pixels tall.

          android:minLines

          Makes the TextView be at least this many lines tall.

          android:minWidth

          Makes the TextView be at least this many pixels wide.

          android:numeric

          If set, specifies that this TextView has a numeric input method.

          android:password

          Whether the characters of the field are displayed as password dots instead of themselves.

          android:phoneNumber

          If set, specifies that this TextView has a phone number input method.

          android:privateImeOptions

          An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method.

          android:scrollHorizontally

          Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally).

          android:selectAllOnFocus

          If the text is selectable, select it all when the view takes focus.

          android:shadowColor

          Place a blurred shadow of text underneath the text, drawn with the specified color.

          android:shadowDx

          Horizontal offset of the text shadow.

          android:shadowDy

          Vertical offset of the text shadow.

          android:shadowRadius

          Blur radius of the text shadow.

          android:singleLine

          Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key.

          android:text

          Text to display.

          android:textAllCaps

          Present the text in ALL CAPS.

          android:textAppearance

          Base text color, typeface, size, and style.

          android:textColor

          Text color.

          android:textColorHighlight

          Color of the text selection highlight.

          android:textColorHint

          Color of the hint text.

          android:textColorLink

          Text color for links.

          android:textCursorDrawable

          Reference to a drawable that will be drawn under the insertion cursor.

          android:textFontWeight

          Weight for the font used in the TextView.

          android:textIsSelectable

          Indicates that the content of a non-editable text can be selected.

          android:textScaleX

          Sets the horizontal scaling factor for the text.

          android:textSelectHandle

          Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text.

          android:textSelectHandleLeft

          Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region.

          android:textSelectHandleRight

          Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region.

          android:textSize

          Size of the text.

          android:textStyle

          Style (normal, bold, italic, bold|italic) for the text.

          android:typeface

          Typeface (normal, sans, serif, monospace) for the text.

          android:width

          Makes the TextView be exactly this wide.

          五、Button支持的其它屬性

          官網(wǎng)對(duì)于Button的屬性沒有列出,因?yàn)樗举|(zhì)上就是一個(gè)TextView,只不過封裝了一下


          主站蜘蛛池模板: 在线观看一区二区精品视频| 亚洲国产一区二区三区| 成人丝袜激情一区二区| 日韩精品一区二区三区四区| 精品不卡一区中文字幕| 亚洲福利视频一区二区| 丝袜人妻一区二区三区| 亚洲一区二区影视| 武侠古典一区二区三区中文| 亚洲无线码一区二区三区| 亚洲AV色香蕉一区二区| 亚洲国产AV无码一区二区三区| 国产精品久久久久久麻豆一区| 国产精品熟女视频一区二区| 亚洲一区免费观看| 国产品无码一区二区三区在线蜜桃 | 手机看片一区二区| 久久国产精品视频一区| 日本一区二区三区不卡视频中文字幕| 大屁股熟女一区二区三区| 无码夜色一区二区三区| 91成人爽a毛片一区二区| 国产在线观看一区二区三区精品 | 日本成人一区二区三区| 国产一区二区免费在线| 人妻夜夜爽天天爽一区| 一夲道无码人妻精品一区二区| 日韩久久精品一区二区三区 | 无码午夜人妻一区二区三区不卡视频| 精品国产福利在线观看一区| 亚洲国产AV一区二区三区四区| 无码精品一区二区三区免费视频| 久久国产高清一区二区三区 | 中文字幕无码不卡一区二区三区| 久久久91精品国产一区二区三区| 精品福利一区二区三区| 国产精品 视频一区 二区三区| 男人免费视频一区二区在线观看| 无码人妻久久一区二区三区免费丨| 久久精品无码一区二区无码| 极品尤物一区二区三区|