Andoid中的布局(按钮)有问题。我想要的是在ScrollView中显示按钮,但ScrollView必须在RelativeLayout之下,或者换句话说,ScrollView的前两个按钮不会显示在我的手机上..
这是我的布局:
SQL = "Select Top 1 SomeTextField From Sites Where H2OBillingIDNum = ...
如何在文字下方展示ScrollView" morska bioloska postaja ..."?
谢谢
答案 0 :(得分:2)
您需要从android:layout_gravity="center"
内的LinearLayout
移除ScrollView
。您可能还想删除其android:paddingTop="90.0dip"
。
答案 1 :(得分:1)
将此内容添加到您的滚动视图中:
android:layout_height="fill_parent"
这应该在textView下面添加滚动,并删除它:
android:layout_height="wrap_content"
并替换为:
<input type="file" name="attach" id="attach-input" multiple="" style="display:none" />
<button type="submit" name="attach" id="attach-button">Upload</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
var button = $('#attach-button');
var input = $('#attach-input');
// translates collection of files into a form
function BuildFormData(files) {
var data = new FormData();
for (var i = 0; i < files.length; i++) {
data.append(files[i].name, files[i]);
}
return data;
}
// posts the files to a given url
function PostData(url, data) {
$.ajax({
// method
type: 'POST',
// endpoint
url: url,
// next 2 lines required for using FormData with jQuery
contentType: false,
processData: false,
// FormData instance
data: data,
// success handler
success: function (result) {
alert('files uploaded successfully');
console.log(result);
}
});
}
// when the button is clicked..
button.on('click', function (e) {
// it launches the file picker
input.click();
});
// when the file picker changes..
input.on('change', function (e) {
// turn it into a form
var data = BuildFormData(e.target.files);
// post the form to the action method
PostData('/Index/Attach', data);
});
</script>