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文字
方法:拖動(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>
接下來我們切換回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)看起來太雜太亂
同理,添加setListener方法,設(shè)置btnChange的點(diǎn)擊事件
private void setListener() {
btnChange.setOnClickListener((v)->{
tvText.setText("我是點(diǎn)擊后的文本");
});
}
別忘了在onCreate()方法里調(diào)用,即在“initView();”后添加“setListener();”;
俗話說,我可以不用,但你必須得有,這不,TextView支持的屬性我理解該有的它都有了,官網(wǎng)對(duì)于TextView屬性介紹如下:
| 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. |
官網(wǎng)對(duì)于Button的屬性沒有列出,因?yàn)樗举|(zhì)上就是一個(gè)TextView,只不過封裝了一下
*請(qǐng)認(rèn)真填寫需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。